Skip to content

Commit 508f95b

Browse files
committed
docs: comprehensive README added
1 parent 654d1c8 commit 508f95b

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# string-utils-lite
2+
3+
[![npm version](https://img.shields.io/npm/v/string-utils-lite?color=blue)](https://www.npmjs.com/package/string-utils-lite)
4+
[![npm downloads](https://img.shields.io/npm/dm/string-utils-lite.svg)](https://www.npmjs.com/package/string-utils-lite)
5+
[![CI](https://github.com/yourname/string-utils-lite/actions/workflows/ci.yml/badge.svg)](https://github.com/yourname/string-utils-lite/actions)
6+
[![license](https://img.shields.io/github/license/yourname/string-utils-lite)](./LICENSE)
7+
8+
> ✨ A tiny, dependency-free library for common string transformations:
9+
> `capitalize`, `titleCase`, `kebab-case`, `snake_case`, `camelCase`, `PascalCase`.
10+
11+
---
12+
13+
## 📦 Installation
14+
15+
```bash
16+
npm install string-utils-lite
17+
18+
19+
## 🚀 Usage
20+
21+
ES Modules
22+
import { capitalize, titleCase, toKebabCase } from 'string-utils-lite';
23+
24+
console.log(capitalize('hELLo')); // "Hello"
25+
console.log(titleCase('hELLO woRLD')); // "Hello World"
26+
console.log(toKebabCase('Hello World')); // "hello-world"
27+
28+
CommonJS
29+
const { capitalize, titleCase } = require('string-utils-lite');
30+
31+
console.log(capitalize('hELLo')); // "Hello"
32+
console.log(titleCase('foo bar')); // "Foo Bar"
33+
34+
## 📚 API Reference
35+
36+
Function Description Example Input Example Output
37+
capitalize(str) Uppercases the first letter, lowercases the rest "hELLo" "Hello"
38+
titleCase(str) Capitalises the first letter of each word "hELLO woRLD" "Hello World"
39+
toKebabCase(str) Converts string to kebab-case "Hello World" "hello-world"
40+
toSnakeCase(str) Converts string to snake_case "Hello World" "hello_world"
41+
toCamelCase(str) Converts string to camelCase "Hello World" "helloWorld"
42+
toPascalCase(str) Converts string to PascalCase "Hello World" "HelloWorld"
43+
44+
All functions are pure and return new strings without mutating the input.
45+
46+
47+
## 🧪 Running Tests
48+
49+
This project uses Vitest.
50+
51+
npm test
52+
53+
## 🛠 Development
54+
55+
Clone the repo and install dependencies:
56+
57+
git clone https://github.com/jahirultusar/JavaScript-string-utils-lite.git
58+
cd string-utils-lite
59+
npm install
60+
61+
62+
Build the package:
63+
64+
npm run build
65+
66+
## 🤝 Contributing
67+
68+
Contributions are welcome! 🎉
69+
70+
Fork the repository
71+
72+
Create a feature branch (git checkout -b feature/my-feature)
73+
74+
Commit your changes (git commit -m 'feat: add new feature')
75+
76+
Push to the branch (git push origin feature/my-feature)
77+
78+
Open a Pull Request
79+
80+
Please follow Conventional Commits for commit messages.
81+
82+
📄 License
83+
84+
MIT © 2025 Jahirul Tusar

0 commit comments

Comments
 (0)