Skip to content

Monsieur-Nico/textConvert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ textConvert πŸ“¦


textConvert is a lightweight, dependency-free library for converting and analyzing text in many formats and conventions.
More features coming soon. Stay tuned!


πŸ“š Table of Contents


πŸš€ Getting Started

Installation

npm install textconvert

Usage

// ES Module
import * as convert from 'textconvert';
// or CommonJS
const convert = require('textconvert');

✨ Features

  • Case conversion: camelCase, PascalCase, snake_case, kebab-case
  • Text analysis: word/letter/sentence/paragraph counting, reading time, etc.
  • Language detection: English, French, Spanish, German, Italian, Portuguese, Dutch
  • Number to words: Converts numbers < 100 million to English words
  • Pure, dependency-free, and TypeScript-ready

Quick Examples

import { camelCase, count, isEmail, isUrl } from 'textconvert';

camelCase('hello world'); // 'helloWorld'
count('Hello, world!'); // 10
isEmail('user@example.com'); // true
isUrl('https://example.com/path?query=123'); // true

See more usage examples in docs/RECIPES.md.


API Docs

See the full API documentation for all functions, parameters, and return types.


Advanced Examples

// Detect language with options
import { detectLanguage, Language } from 'textconvert';
const result = detectLanguage('Hola mundo', 4, { maxCharsToAnalyze: 300 });
if (result.language === Language.Spanish) {
  console.log('Spanish detected!');
}

// Get detailed text statistics
const stats = convert.getTextStats('Hello world. This is a test.');
console.log(stats.wordCount, stats.readingTimeFormatted);

// Convert numbers to words
console.log(convert.numbersToWords(987654));
// "nine hundred eighty-seven thousand six hundred and fifty-four"

Why Use textConvert?

  • Lightweight & Dependency-Free: No external dependencies, fast and easy to use.
  • Comprehensive Text Utilities: Covers case conversion, text analysis, language detection, and more.
  • TypeScript Support: Fully typed for safe and productive development.
  • Modern API: Designed for clarity, performance, and extensibility.
  • Actively Maintained: Open to contributions and new features.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines and workflow.

If you are adding a new function, follow the step-by-step instructions in docs/ADDING_FUNCTION.md.


Changelog

See CHANGELOG.md for release history and updates.


License

This project is licensed under the MIT License.


Contributors ✨

Nicolas Alkhoury
Nicolas Alkhoury

πŸ’¬ πŸ› πŸ’Ό πŸ’» πŸ”£ 🎨 πŸ“– πŸ€” πŸš‡ 🚧 πŸ§‘β€πŸ« πŸ“¦ πŸ”Œ πŸ“† πŸ”¬ πŸ‘€ ⚠️ πŸ”§ πŸ““
Madesh
Madesh

πŸ’» πŸ“– πŸ’‘ ⚠️
Kuba
Kuba

πŸ’» πŸ“– πŸ’‘

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Public library to convert text into many conventions and formats.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •