Skip to content
/ strx Public

Repository for NPM package @n1hal/strx, utility package for string manipulations and string related tools

License

Notifications You must be signed in to change notification settings

ioNihal/strx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@n1hal/strx

Repository for NPM package @n1hal/strx, utility package for string manipulations and string related tools. Small, dependency-free string helpers — clean, consistent, and zero bloat.

npm version license npm bundle size


🚀 Features

  • 💡 Lightweight – No dependencies, <1 KB minified.
  • Modern ESM – Works seamlessly in Node and browsers.
  • 📚 Typed – Includes full TypeScript definitions.
  • Handy – Covers common string formatting and casing tasks.

📦 Installation

npm i @n1hal/strx

Or with pnpm:

pnpm add @n1hal/strx

Or with Yarn:

yarn add @n1hal/strx

🧠 Usage

import { capitalize, slugify, camelCase } from "@n1hal/strx";

capitalize("hello world"); // → "Hello world"
camelCase("hello world");  // → "helloWorld"
slugify("Hello World! Café"); // → "hello-world-cafe"

Or use the default export:

import strx from "@n1hal/strx";

strx.titleCase("once upon a time"); // → "Once Upon A Time"
strx.truncate("A very long text that should be shortened", 20);
// → "A very long text..."

⚙️ TypeScript Support

All functions are typed automatically:

import { titleCase } from "@n1hal/strx";

const title: string = titleCase("make it nice");

🧪 Example Playground

You can quickly test all functions in Node REPL:

node
> import * as strx from "@n1hal/strx";
> strx.camelCase("Hello there friend");
'helloThereFriend'

📖 License

MIT © 2025 Nihal K


🌟 Contribute

If you’d like to suggest new helpers or improve code coverage:

  1. Fork the repo
  2. Add your function to index.js
  3. Export and update index.d.ts
  4. Open a PR ✨

Keep your strings sharp with @n1hal/strx ✂️

About

Repository for NPM package @n1hal/strx, utility package for string manipulations and string related tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •