DEV Community

Cover image for Building and Publishing My First npm Library: string-utils-lite
Jahirul Tusar
Jahirul Tusar

Posted on

Building and Publishing My First npm Library: string-utils-lite

For a while, I’ve had the idea of publishing my own npm package. Like many developers, I use open-source libraries every day, and I wanted to experience what it’s like to create something others might use. Recently, I finally took the leap and published string-utils-lite, a small JavaScript utility library.

Why Build This Library?

JavaScript has excellent flexibility, but it lacks some of the string helpers you find in languages like Python. Python developers can reach for .capitalize() or .title() out of the box, but JavaScript doesn’t include those.

Of course, there are big libraries like Lodash that cover everything — but they can feel heavy if you only need one or two simple functions. I wanted something lightweight, dependency-free, and modern.

That’s where string-utils-lite comes in. It provides a handful of simple, useful string transformation functions:

capitalize → "hELLo" → "Hello"

titleCase → "hELLO woRLD" → "Hello World"

toKebabCase → "Hello World" → "hello-world"

toSnakeCase → "Hello World" → "hello_world"

toCamelCase → "Hello World" → "helloWorld"

toPascalCase → "Hello World" → "HelloWorld"

It’s small, tree-shakable, and easy to drop into any project.

My GitHub page

Top comments (0)