Package Managers
Standard installation using npm, yarn, pnpm, pip, poetry, conda for JavaScript and Python projects
The most common way to install Glin-Profanity is through standard package managers. Choose your preferred language and package manager below.
JavaScript / TypeScript
npm install glin-profanityTypeScript Support
Types are included automatically - no additional @types/ package needed.
npm install glin-profanity
# Types included out of the box ✓yarn add glin-profanityYarn Workspaces
For monorepo setups with Yarn workspaces:
yarn workspace my-app add glin-profanitypnpm add glin-profanityWorkspace Setup
For pnpm workspaces:
pnpm add glin-profanity --filter my-appQuick Verification (JavaScript)
Create a test file to verify installation:
import { checkProfanity } from 'glin-profanity';
// Basic profanity check
const result = checkProfanity('This is a clean message', {
languages: ['english']
});
console.log('✓ Installation successful:', !result.containsProfanity);
console.log('Available methods:', Object.keys(result));Run the test:
node test-installation.jsExpected output:
✓ Installation successful: true
Available methods: ['containsProfanity', 'profaneWords', 'processedText', ...]TypeScript Integration
import {
checkProfanity,
ProfanityCheckerConfig,
ProfanityCheckResult
} from 'glin-profanity';
const config: ProfanityCheckerConfig = {
languages: ['english', 'spanish'],
enableContextAware: true,
autoReplace: true
};
const result: ProfanityCheckResult = checkProfanity('Test message', config);
// Full type safety and IntelliSense support ✓
console.log(result.containsProfanity); // boolean
console.log(result.profaneWords); // string[]
console.log(result.processedText); // string | undefinedPython
pip install glin-profanityVirtual Environment (Recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install glin-profanityDevelopment Dependencies
pip install glin-profanity[dev]
# Includes: mypy, pytest, black, ruffpoetry add glin-profanityDevelopment Group
poetry add glin-profanity --group devMultiple Groups
poetry add glin-profanity # Main dependencies
poetry add pytest mypy --group test
poetry add black ruff --group lintconda install -c conda-forge glin-profanityConda Environment
conda create -n profanity-env python=3.10
conda activate profanity-env
conda install -c conda-forge glin-profanityQuick Verification (Python)
Create a test file to verify installation:
from glin_profanity import Filter
# Create filter instance
filter_instance = Filter({
"languages": ["english"],
"enable_context_aware": True
})
# Basic profanity check
result = filter_instance.check_profanity("This is a clean message")
print(f"✓ Installation successful: {not result['contains_profanity']}")
print(f"Available fields: {list(result.keys())}")Run the test:
python test_installation.pyExpected output:
✓ Installation successful: True
Available fields: ['contains_profanity', 'profane_words', 'processed_text', ...]Type Checking (Python)
from typing import Dict, List, Any
from glin_profanity import Filter, FilterConfig
# Type-safe configuration
config: FilterConfig = {
"languages": ["english", "spanish"],
"enable_context_aware": True,
"auto_replace": True
}
filter_instance: Filter = Filter(config)
# Type hints for results
result: Dict[str, Any] = filter_instance.check_profanity("Test message")
# MyPy compatible type checking ✓
contains_profanity: bool = result["contains_profanity"]
profane_words: List[str] = result["profane_words"]Development Dependencies
JavaScript Development
npm install --save-dev @types/node typescript ts-node
npm install glin-profanity
# For testing
npm install --save-dev jest @types/jestPython Development
pip install glin-profanity
pip install --dev mypy pytest black ruff
# Or with poetry
poetry add glin-profanity
poetry add mypy pytest black ruff --group devPackage Details
JavaScript Package
{
"dependencies": {
"glin-profanity": "^2.3.2"
}
}Package size: ~850KB (includes 23 language dictionaries)
Tree-shaking: Supports ES modules and dead code elimination
Dependencies: Zero runtime dependencies
Browser support: ES2020+ (Chrome 80+, Firefox 72+, Safari 13.1+)
Python Package
[tool.poetry.dependencies]
python = "^3.8"
glin-profanity = "^2.3.2"Package size: ~1.2MB (includes language dictionaries and type stubs)
Dependencies: No required dependencies, optional dev dependencies
Python support: 3.8, 3.9, 3.10, 3.11, 3.12
Type checking: Full MyPy support with included stubs
Troubleshooting Installation
Common JavaScript Issues
Module Resolution
Issue: Cannot resolve module 'glin-profanity'
Solutions:
# Clear npm cache
npm cache clean --force
npm install
# Check Node.js version
node --version # Should be 16.0.0+
# Reinstall with exact version
npm install glin-profanity@2.3.2Common Python Issues
Import Errors
Issue: ModuleNotFoundError: No module named 'glin_profanity'
Solutions:
# Check Python version
python --version # Should be 3.8.0+
# Check installation
pip show glin-profanity
# Force reinstall
pip uninstall glin-profanity
pip install glin-profanity
# Virtual environment activation
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # WindowsNetwork Issues
If you're behind a corporate firewall:
# npm with proxy
npm install glin-profanity --proxy http://proxy.company.com:8080
# pip with proxy
pip install glin-profanity --proxy http://proxy.company.com:8080
# Or set environment variables
export https_proxy=http://proxy.company.com:8080
export http_proxy=http://proxy.company.com:8080Memory Issues
For memory-constrained environments:
// Import only what you need
import { checkProfanity } from 'glin-profanity/core';
// Smaller bundle size, basic functionality only# Use specific language dictionaries only
from glin_profanity import Filter
filter_instance = Filter({
"languages": ["english"], # Single language only
"enable_context_aware": False # Disable NLP features
})Next Steps
After successful installation:
- Quick Start: Try the Quick Start Guide for working examples
- Configuration: Learn about Configuration Options to customize behavior
- Framework Integration: Set up with React, Vue, Django, or Flask
- API Reference: Explore the complete API Documentation
Having issues? Check our Troubleshooting Guide or GitHub Issues for additional help.