npm package: @kaushverse/text-engine
Description: Lightweight TypeScript text engine for emoji extraction, removal, and text normalization.
Author: Kaushik
Latest version: 1.0.12

# 🚀 @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

```bash
npm install @kaushverse/text-engine
```

---

## 🚀 Usage

### 🔥 Basic Example

```ts
import { normalizeText } from "@kaushverse/text-engine";

const result = normalizeText("🚀 Hello---World__test!!");

console.log(result);
```

### ✅ Output

```ts
{
  clean: "Hello World Test",
  slug: "hello-world-test",
  icon: "🚀",
  emojis: ["🚀"]
}
```

---

## 🔧 Core APIs

### 🧠 normalizeText()

Full pipeline processing:

```ts
normalizeText("🔥 Hello World");
```

| Field  | Description         |
| ------ | ------------------- |
| clean  | Human readable text |
| slug   | URL-safe string     |
| icon   | First emoji         |
| emojis | All emojis          |

---

### 🔗 slugify()

```ts
slugify("Hello World 🔥");
// "hello-world"
```

---

### 🔤 normalize()

```ts
normalize("Café Déjà Vu");
// "Cafe Deja Vu"
```

---

## 😀 Emoji Utilities

### extractEmoji()

```ts
extractEmoji("Hi 🔥🚀");
// ["🔥", "🚀"]
```

### removeEmoji()

```ts
removeEmoji("Hi 🔥");
// "Hi"
```

### replaceEmoji()

```ts
replaceEmoji("Hi 🔥", () => "*");
// "Hi *"
```

---

## 🧰 Utility Functions

### 🧹 cleanSeparators()

```ts
cleanSeparators("hello---world__test");
// "hello world test"
```

---

### 🔠 capitalize()

```ts
capitalize("hello");
// "Hello"
```

---

### 🧠 detectCase()

Supports 20+ patterns 👇

```ts
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

```bash
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