Thanks to visit codestin.com
Credit goes to github.com

Skip to content

πŸš€AI-powered grammar checker for developers πŸ§‘β€πŸ’»βœ¨ | Supports 50+ languages 🌍 | Fast ⚑, private πŸ”’ & code-aware πŸ’» | TypeScript-first with CLI πŸ› οΈ

License

Notifications You must be signed in to change notification settings

abdelkabirouadoukou/grammar-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Grammar-AI πŸš€

npm version Downloads License: MIT

The most advanced AI-powered grammar checker built for developers. Supports 50+ languages with Groq, OpenAI, Google Gemini & DeepSeek integration.

✨ Why Choose Grammar-AI?

  • 🧠 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

πŸš€ Quick Start

npm install grammar-ai
import { 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 }]

🎯 Core Features

1. Zero-Config Magic ✨

import { check } from 'grammar-ai';

// Works out of the box
const result = await check('Your text here');

2. Multiple Input Formats πŸ“

// 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');

3. Real-time Streaming 🌊

const stream = check.stream('Very long document text...');

for await (const chunk of stream) {
  console.log(chunk.corrections);
  // Get corrections as they're found
}

4. Smart Auto-Fix 🧠

const result = await check(text, { 
  autoFix: 'confident', // Only fix 95%+ confidence
  preserveStyle: true   // Keep your writing voice
});

console.log(result.fixedText);

5. Domain-Specific Modes 🎭

// 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' });

βš™οΈ Advanced Configuration

AI Provider Setup

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
});

Express.js Integration πŸš€

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);

πŸ–₯️ CLI Tool

# 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

🌍 Multilingual Support

// 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 language

πŸ”₯ Advanced Features

Code-Aware Checking πŸ’»

const 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"

Tone & Sentiment Analysis πŸ“Š

const result = await check(text, { 
  analyzeTone: true,
  targetTone: 'professional'
});

console.log(result.tone);
// { formality: 0.8, emotion: 'neutral', bias: 'none' }

Learning & Personalization 🎯

const checker = new GrammarAI({
  learn: true,           // Adapts to your style
  userProfile: 'dev',    // Understands technical writing
  customRules: ['no-passive-voice-in-docs']
});

Export Multiple Formats πŸ“„

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 reports

πŸ“– TypeScript Support

import { 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);

πŸ”Œ Plugin Ecosystem

// 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);

πŸ’° Pricing

Free Tier

  • βœ… 1,000 checks/month
  • βœ… Basic grammar checking
  • βœ… 5 languages
  • βœ… Community support

Pro Tier ($19/month)

  • βœ… Unlimited checks
  • βœ… All AI features
  • βœ… 50+ languages
  • βœ… Priority support
  • βœ… Advanced analytics

Enterprise ($99/month)

  • βœ… On-premise deployment
  • βœ… Custom model training
  • βœ… SSO integration
  • βœ… SLA guarantees

🀝 Contributing

We welcome contributions! Please see our Contributing Guide.

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ†˜ Support


Made with ❀️ for developers who care about great writing

About

πŸš€AI-powered grammar checker for developers πŸ§‘β€πŸ’»βœ¨ | Supports 50+ languages 🌍 | Fast ⚑, private πŸ”’ & code-aware πŸ’» | TypeScript-first with CLI πŸ› οΈ

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published