Skip to main content

Introduction

Version CircleCI

In this vast landscape of JavaScript and TypeScript development, having a reliable set of tools at your disposal when building web projects can make all the difference. @feedzai/js-utilities is a comprehensive collection of JavaScript helpers, functions and custom React hooks designed to streamline projects with ease and efficiency.

With this package, developers gain access to a treasure trove of utilities crafted to simplify common tasks encountered in JS/TS projects. From handy helpers to custom React hooks, this library empowers developers to write cleaner, more concise code without sacrificing functionality.

Each function and hook is tested to ensure functionality and effectiveness, whilst giving developers the confidence to integrate them seamlessly into their projects.

It also comes with comprehensive documentation, making it a breeze to navigate and utilize its features effectively.

The package is available in both CommonJS and ES Modules formats so, whether you're working in a traditional environment or embracing the latest ES Modules, we have you covered.

For JavaScript and TypeScript developers seeking a lightweight but robust toolkit that balances simplicity with utility, @feedzai/js-utilities might jus be the answer!

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies or devDependencies:

## using npm
npm install @feedzai/js-utilities

## using yarn
yarn add @feedzai/js-utilities

## using pnpm
pnpm add @feedzai/js-utilities

Usage

This is a collection of functions, utilities and react hooks. You'll find all available code in src.

The bundle is available as:

  • ES Modules
  • CommonJS

To import a piece of code into your javascript project just do:

// Just one function
import { isNil } from "@feedzai/js-utilities";

// Just a single module, with the full path to the file
import isNil from "@feedzai/js-utilities/dist/functions/typed/is-nil";

// Multiple functions
import { callIfExists, throwError, getLSItem } from "@feedzai/js-utilities";

// React Hooks
import { useMount, useConstant } from "@feedzai/js-utilities/hooks";

// Alias the whole object
import * as JS_UTILS from "@feedzai/js-utilities";