The most advanced AI-powered grammar checker built for developers. Supports 50+ languages with Groq, OpenAI, Google Gemini & DeepSeek integration.
- π§ AI-Powered: Multiple AI providers (Groq, OpenAI, Google, DeepSeek)
- β‘ Blazing Fast: < 100ms response time with smart caching
- π 50+ Languages: Best-in-class multilingual support
- π Privacy First: Works offline, no data tracking
- π° Cost Optimized: Auto-switches to cheapest accurate provider
- π οΈ Developer Focused: Code-aware, TypeScript-first, CLI included
npm install grammar-aiimport { check } from 'grammar-ai';
// Zero-config setup - just works!
const result = await check('This are a test sentence.');
console.log(result.corrections);
// [{ original: 'This are', corrected: 'This is', confidence: 0.95 }]import { check } from 'grammar-ai';
// Works out of the box
const result = await check('Your text here');// Text string
await check.text('Hello world');
// File paths
await check.file('./document.md');
// URLs
await check.url('https://blog.com/post');
// Code comments
await check.code('// Check this comment');const stream = check.stream('Very long document text...');
for await (const chunk of stream) {
console.log(chunk.corrections);
// Get corrections as they're found
}const result = await check(text, {
autoFix: 'confident', // Only fix 95%+ confidence
preserveStyle: true // Keep your writing voice
});
console.log(result.fixedText);// Academic writing
await check(text, { mode: 'academic' });
// Marketing copy
await check(text, { mode: 'marketing' });
// Technical documentation
await check(text, { mode: 'technical' });
// Casual blog posts
await check(text, { mode: 'casual' });import { GrammarAI } from 'grammar-ai';
const checker = new GrammarAI({
// Multiple AI providers
providers: {
groq: { apiKey: 'your-groq-key' },
openai: { apiKey: 'your-openai-key' },
google: { apiKey: 'your-google-key' },
deepseek: { apiKey: 'your-deepseek-key' }
},
// Cost optimization
budget: { maxCostPerMonth: 50 },
provider: 'auto', // Chooses cheapest accurate option
// Performance
caching: 'aggressive',
offline: true // Works without internet
});import express from 'express';
import { check } from 'grammar-ai';
const app = express();
app.use(express.json());
// Grammar check endpoint
app.post('/api/grammar-check', async (req, res) => {
try {
const { text, options } = req.body;
const result = await check(text, options);
res.json({
success: true,
corrections: result.corrections,
metrics: result.metrics,
confidence: result.confidence
});
} catch (error) {
res.status(500).json({
success: false,
error: error.message
});
}
});
// Streaming endpoint
app.post('/api/grammar-stream', async (req, res) => {
res.setHeader('Content-Type', 'text/event-stream');
const stream = check.stream(req.body.text);
for await (const chunk of stream) {
res.write(`data: ${JSON.stringify(chunk)}\n\n`);
}
res.end();
});
app.listen(3000);# Install globally
npm install -g grammar-ai
# Check single file
grammar-ai check document.md
# Check multiple files with auto-fix
grammar-ai check *.md --fix --stats
# Watch mode for development
grammar-ai watch src/ --auto-fix
# CI/CD integration
grammar-ai check *.md --ci --fail-on-errors// Auto-detects language
await check('This is English text.');
await check('Ceci est un texte franΓ§ais.');
await check('Dies ist ein deutscher Text.');
await check('ΩΨ°Ψ§ ΩΨ΅ ΨΉΨ±Ψ¨Ω.');
// Mixed languages in same text
const mixed = "Hello! Comment Γ§a va? ε
ζ°γ§γγοΌ";
const result = await check(mixed);
// Applies appropriate rules for each languageconst code = `
/**
* This function calcuate the total
* @param items - list of item to sum
*/
function sum(items) { ... }
`;
const result = await check.code(code);
// Fixes: "calcuate" β "calculate", "item" β "items"const result = await check(text, {
analyzeTone: true,
targetTone: 'professional'
});
console.log(result.tone);
// { formality: 0.8, emotion: 'neutral', bias: 'none' }const checker = new GrammarAI({
learn: true, // Adapts to your style
userProfile: 'dev', // Understands technical writing
customRules: ['no-passive-voice-in-docs']
});const result = await check(text);
result.export('json'); // For APIs
result.export('sarif'); // For security tools
result.export('junit'); // For CI systems
result.export('html'); // For reportsimport { GrammarResult, CheckOptions } from 'grammar-ai';
interface GrammarResult {
corrections: Correction[];
suggestions: Suggestion[];
confidence: number;
metrics: ReadabilityMetrics;
tone?: ToneAnalysis;
}
const result: GrammarResult = await check(text, {
mode: 'technical',
autoFix: 'confident',
analyzeTone: true
} as CheckOptions);// Extend functionality
import { spellCheck } from '@grammar-ai/spell';
import { plagiarism } from '@grammar-ai/plagiarism';
import { accessibility } from '@grammar-ai/a11y';
checker.use(spellCheck, plagiarism, accessibility);- β 1,000 checks/month
- β Basic grammar checking
- β 5 languages
- β Community support
- β Unlimited checks
- β All AI features
- β 50+ languages
- β Priority support
- β Advanced analytics
- β On-premise deployment
- β Custom model training
- β SSO integration
- β SLA guarantees
We welcome contributions! Please see our Contributing Guide.
MIT License - see LICENSE file for details.
- π§ Email: [email protected]
- π Docs: Full documentation
- π Issues: GitHub Issues
Made with β€οΈ for developers who care about great writing