Socket
Socket
Sign inDemoInstall

@types/humanize-duration

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/humanize-duration

TypeScript definitions for humanize-duration


Version published
Weekly downloads
154K
increased by1.22%
Maintainers
1
Weekly downloads
 
Created

What is @types/humanize-duration?

@types/humanize-duration provides TypeScript type definitions for the humanize-duration library, which is used to convert durations, given in milliseconds, into human-readable strings.

What are @types/humanize-duration's main functionalities?

Basic Usage

Converts a duration in milliseconds to a human-readable string.

const humanizeDuration = require('humanize-duration');
const humanized = humanizeDuration(3000); // '3 seconds'

Custom Units

Allows customization of the units used in the output string.

const humanizeDuration = require('humanize-duration');
const humanized = humanizeDuration(3000, { units: ['h', 'm', 's'] }); // '3 seconds'

Language Support

Supports multiple languages for the output string.

const humanizeDuration = require('humanize-duration');
const humanized = humanizeDuration(3000, { language: 'es' }); // '3 segundos'

Round

Rounds the output to the nearest integer.

const humanizeDuration = require('humanize-duration');
const humanized = humanizeDuration(3000, { round: true }); // '3 seconds'

Largest

Limits the number of units in the output string.

const humanizeDuration = require('humanize-duration');
const humanized = humanizeDuration(3000, { largest: 1 }); // '3 seconds'

Other packages similar to @types/humanize-duration

FAQs

Package last updated on 04 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc