🚀 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.
- 💻 Requirements
- ⚙️ Installation
- ✨ Features
- 🧬 NextJS Support
- 💎 Detailed Features
- 🔥 Usage
- ❤️ Sponsor
- 📜 Changelog
- 🤝 Contributing
- 🛡 Security
- 🙌 Credits
- 📄 License
-
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)
npm install rzl-utils-js
yarn add rzl-utils-js
pnpm add rzl-utils-js
- 🚀 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.
This package also provides utilities specially built for Next.js environments, neatly separated into their own entry points:
-
Helpers for building URLs, generating dynamic routes, reading environment variables, etc.
✅ Safe to use in both Next.js pages & API routes.
-
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.
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.
import { isServer } from "rzl-utils-js";
console.log(isServer());
// true if running on Node.js, false if browser
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
Help support development:
👉 Become a sponsor
See CHANGELOG.
See CONTRIBUTING.
Please report issues to rizalvindwiky1998@gmail.com.
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!