UtilsJSInstallation

Installation

How to install UtilsJS version 3.

Getting Started

Welcome to the UtilsJS (v3) installation guide, follow the steps below to quickly set up the package and enable autocomplete support in your editor.

Before installing, please ensure your environment meets the requirements, if you haven’t checked them yet, you can find the prerequisites here:

Installation Guide

You can install UtilsJS using your preferred package manager, below are example commands for different package managers.

npm install @rzl-zone/utils-js@latest

Verify Installation

After installing, test the package with a quick import:

import { isEmpty } from "@rzl-zone/utils-js/predicates";

console.log(isEmpty({})); // true

Autocomplete Hint

Improve TypeScript editor import suggestions for @rzl-zone/utils-js, so all functions, types, and modules appear instantly when triggering autocomplete — press Ctrl+Space (Windows/Linux), ⌘+Space (macOS), or your editor’s autocomplete shortcut.

This works across modern TypeScript-supported editors (e.g., VSCode, WebStorm, Vim extensions, NeoVim LSP, Cursor) without requiring triple-slash references — the package is fully indexed automatically through your editor’s TypeScript language service.

Install @rzl-zone/utils-js.

Create a types folder.

  • Inside your project root, make a folder called types:

    index.d.ts
    jsconfig.json(for JavaScript projects)
    tsconfig.json

Add the global reference file.

  • Add to types/index.d.ts with this content:

    types/index.d.ts
    /// <reference types="@rzl-zone/utils-js" />
  • This tells TypeScript to include the types from @rzl-zone/utils-js globally.

  • You can add more references here if needed, for example:

    types/index.d.ts
    /// <reference types="@rzl-zone/utils-js" />
    
    // Example more references (if needed):
    /// <reference types="node" />
    /// <reference types="react" />

Update tsconfig.json.

  • Make sure add types folder to "include", so TypeScript automatically picks up your types folder:

    tsconfig.json
    {
      "compilerOptions": {
        "strict": true,
        // other your config...
      },
      "include": [
        "src",
        "types"
      ]
      // other your config...
    }
  • The types folder comes first, so your references override or add to the default @types packages

Update jsconfig.json (for JavaScript projects).

  • If you also work with JS, do the same:

    jsconfig.json
    {
      "compilerOptions": {
        // Optional, enables type checking
        "checkJs": true,
        // other your config...
      },
      "include": [
        "src",
        "types"
      ]
      // other your config...
    }

    Tip

    For JS projects, consider adding "checkJs": true, for better IntelliSense.

Restart your editor/IDE.

  • This forces your TypeScript language service to re-index the package.
  • After restart, all functions, types, and modules from @rzl-zone/utils-js will appear instantly in autocomplete.

Troubleshooting

If you encounter issues such as missing types, IntelliSense errors, or unexpected behavior:

General Fixes

  • Clear your package manager cache
  • Reinstall node_modules
  • Ensure your environment supports ESM or CJS

TypeScript Users (VSCode / IDE)

  • After installing or updating the package:
    1. Open the Command Palette
    2. Select “TypeScript: Restart TS Server”
    3. If using tsconfig.json, ensure moduleResolution is set properly

JavaScript Users

  • Reload your editor/IDE to refresh auto-completions
  • Ensure your bundler (Vite, Next.js, Webpack, etc.) has restarted

UtilsJS includes both ESM and CJS builds for maximum compatibility across modern tooling.