textconvert
TypeScript icon, indicating that this package has built-in type declarations

1.5.3 • Public • Published

📦 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 } from 'textconvert';

camelCase('hello world'); // 'helloWorld'
count('Hello, world!'); // 10
isEmail('user@example.com'); // 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

💬 🐛 💼 💻 🔣 🎨 📖 🤔 🚇 🚧 🧑‍🏫 📦 🔌 📆 🔬 👀 ⚠️ 🔧 📓

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

Package Sidebar

Install

npm i textconvert

Weekly Downloads

33

Version

1.5.3

License

MIT

Unpacked Size

311 kB

Total Files

29

Last publish

Collaborators

  • monsieur-nico