@kaushverse/text-engine
v1.0.12
Published
Lightweight TypeScript text engine for emoji extraction, removal, and text normalization.
Maintainers
Readme
🚀 @kaushverse/text-engine
⚡ Lightweight, powerful TypeScript text processing engine for emoji handling, slug generation, and smart text normalization.
✨ Features
- 😀 Extract / Remove / Replace Emojis
- 🔤 Smart Text Normalization
- 🔗 SEO-friendly Slug Generator
- 🧠 Advanced Case Detection Engine
- 🧹 Clean & Format Messy Input
- ⚡ Zero Dependencies
- 🧾 Fully Typed (TypeScript)
📦 Installation
npm install @kaushverse/text-engine🚀 Usage
🔥 Basic Example
import { normalizeText } from "@kaushverse/text-engine";
const result = normalizeText("🚀 Hello---World__test!!");
console.log(result);✅ Output
{
clean: "Hello World Test",
slug: "hello-world-test",
icon: "🚀",
emojis: ["🚀"]
}🔧 Core APIs
🧠 normalizeText()
Full pipeline processing:
normalizeText("🔥 Hello World");| Field | Description | | ------ | ------------------- | | clean | Human readable text | | slug | URL-safe string | | icon | First emoji | | emojis | All emojis |
🔗 slugify()
slugify("Hello World 🔥");
// "hello-world"🔤 normalize()
normalize("Café Déjà Vu");
// "Cafe Deja Vu"😀 Emoji Utilities
extractEmoji()
extractEmoji("Hi 🔥🚀");
// ["🔥", "🚀"]removeEmoji()
removeEmoji("Hi 🔥");
// "Hi"replaceEmoji()
replaceEmoji("Hi 🔥", () => "*");
// "Hi *"🧰 Utility Functions
🧹 cleanSeparators()
cleanSeparators("hello---world__test");
// "hello world test"🔠 capitalize()
capitalize("hello");
// "Hello"🧠 detectCase()
Supports 20+ patterns 👇
detectCase("data_base");
// "snake_case"Supported Types:
- 🐍 snake_case
- 🔗 kebab-case
- 🐪 camelCase
- 🏔️ PascalCase
- 🔊 UPPER_CASE
- 🔡 lowercase
- 🔠 Title Case
- 📝 Sentence case
- 🎲 Mixed Case
- 🌪️ Weird Spacing
- 🧵 Concatenated
- 🎯 Dot.notation
- 📂 Path style
- 🔢 Alphanumeric
- 🧬 UUID-like
- 😀 Emoji Text
- 🏷️ Tagged Text
- 💬 Special chars
- 🌐 URL Slug
- 🧾 JSON key style
- 🤯 Human messy input
🧱 Architecture
input
↓
extractEmoji
↓
removeEmoji
↓
cleanSeparators
↓
formatText
↓
slugify🧪 Testing
npm test✔ 60+ test cases ✔ Edge cases covered ✔ Production-ready
⚡ Performance
- 🚫 No external dependencies
- ⚡ Optimized regex
- 🧠 Smart detection ordering
🛠️ Tech Stack
- TypeScript
- Jest
- Node.js
📌 Roadmap
- 🔁 convertCase (any → any)
- 🌍 Multi-language slug support
- 🧠 AI text cleanup
- CLI tool
🤝 Contributing
PRs are welcome! Feel free to improve.
📄 License
MIT © Kaushverse
⭐ Support
If you like this project:
⭐ Star the repo 📦 Use it in your projects 🚀 Share with others
Built with 🔥 by Kaushik
