rzl-utils-js
TypeScript icon, indicating that this package has built-in type declarations

0.2.5 • Public • Published

⚡️ rzl-utils-js 🚀

🚀 Rzl Utility JavaScript 🚀
A lightweight, modern TypeScript utility library for Node.js & browser (via bundlers like Webpack / Vite).
Provides reusable helpers to simplify your JavaScript / TypeScript projects.
Built with ❤️ by @rzl-app.

Latest Version on NPM downloads Node.js PRs Welcome GitHub license GitHub Repo on GitHub


📚 Table of Contents


💻 Requirements

  • Node.js >= 16.0.0 or >=18.17.0
    This package leverages modern JavaScript & TypeScript features that require Node.js version 16.0.0 if not using nextjs and 18.17.0 or higher for nextjs.

  • Works with:

    • ✅ Node.js (16.0.0+) - Without NextJS
    • ✅ Node.js (18.17.0+) - With NextJS
    • ✅ Modern browsers (via bundlers like Webpack / Vite)

⚙️ Installation

With NPM

  npm install rzl-utils-js

With Yarn

  yarn add rzl-utils-js

With PNPM

  pnpm add rzl-utils-js

✨ Features

  • 🚀 Written in TypeScript — fully typed & safe
  • ⚡ Small, tree-shakable & fast
  • 📦 Works in Node.js & modern browsers
  • ❤️ Simple API, easy to extend
  • 🧬 Next.js support: helpers for dynamic routes, building URLs, reading env, extracting client IP
  • 🛠 Additional TypeScript types: OmitStrict, PartialByKeys, etc.

🧬 Next.js Support

This package also provides utilities specially built for Next.js environments, neatly separated into their own entry points:

  • `rzl-utils-js/next`

    Helpers for building URLs, generating dynamic routes, reading environment variables, etc.

    ✅ Safe to use in both Next.js pages & API routes.

    Read More Docs


  • `rzl-utils-js/next/server`

    Utilities meant to run in Next.js server-only contexts (like middleware or server actions) for tasks such as extracting real client IPs.

    ⚠️ Will throw if used outside a Next.js server environment.

    Read More Docs


💎 Detailed Features

Docs is coming soon.

For the time being, you can use the feature manually:

import { | } from "rzl-utils-js";
import { | } from "rzl-utils-js\types";
import { | } from "rzl-utils-js\next";
import { | } from "rzl-utils-js\next\server";

// Just place your cursor right inside { } like the pipe ("|") above then
// ctrl + space, there are many functions or types and then hover to each
// function is complete with how to use it because I have added jsDoc.

🔥 Usage

Easy to use, just import on your code base.

Example Function Import:
import { isServer } from "rzl-utils-js";

console.log(isServer());
// true if running on Node.js, false if browser
Example TypeScript Helper Import:
import type { OmitStrict } from "rzl-utils-js/types";

type MyType = OmitStrict<OtherType, "omitedProps">;
// Fully strict TS omit that requires all keys to exist in target

❤️ Sponsor this package

Help support development:
👉 Become a sponsor


📝 Changelog

See CHANGELOG.


🤝 Contributing

See CONTRIBUTING.


🛡 Security

Please report issues to rizalvindwiky1998@gmail.com.


🙌 Credits


📜 License

The MIT License (MIT).
Please see License File for more information.


Enjoy using rzl-utils-js?
Star this repo ⭐ and share it with other JavaScript developers!


Package Sidebar

Install

npm i rzl-utils-js

Weekly Downloads

530

Version

0.2.5

License

MIT

Unpacked Size

993 kB

Total Files

14

Last publish

Collaborators

  • rzl-app