HumanizerInstallation

Installation

Last updated:

Installation

npm install @visulima/humanizer

Import

Main Functions

import { formatBytes, parseBytes, duration, parseDuration } from "@visulima/humanizer";

Language Packs (Duration)

Import specific languages for duration formatting:

import { durationLanguage as de } from "@visulima/humanizer/language/de";
import { durationLanguage as es } from "@visulima/humanizer/language/es";
import { durationLanguage as fr } from "@visulima/humanizer/language/fr";

duration(3000, { language: de });
// => "3 Sekunden"

TypeScript Types

import type {
    FormateByteOptions,
    ParseByteOptions,
    DurationOptions,
    DurationLanguage,
    DurationUnit,
} from "@visulima/humanizer";

Requirements

  • Node.js: 22.13 or higher
  • TypeScript: 5.0 or higher (if using TypeScript)
  • ECMAScript: ES2020 or higher

Verification

Verify installation by running a simple example:

import { formatBytes, duration } from "@visulima/humanizer";

console.log(formatBytes(1024));
// => "1 KB"

console.log(duration(3000));
// => "3 seconds"
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues