You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

humanize-ms

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

humanize-ms

transform humanize time to ms


Version published
Weekly downloads
7.7M
decreased by-16.26%
Maintainers
1
Install size
12.0 kB
Created
Weekly downloads
 

Package description

What is humanize-ms?

The humanize-ms npm package is designed to convert various time formats into milliseconds. It is particularly useful for applications that need to handle and manipulate time intervals in a human-readable format and then convert them to milliseconds for processing or scheduling tasks.

What are humanize-ms's main functionalities?

Convert human-readable strings to milliseconds

This feature allows the conversion of a human-readable string like '2 days' into its equivalent in milliseconds. It is useful for setting timeouts, intervals, or calculating durations in applications.

const humanize = require('humanize-ms');
console.log(humanize('2 days')); // 172800000

Support for various time units

The package supports various time units such as hours, minutes, and seconds, allowing for flexible conversions depending on the needs of the application.

const humanize = require('humanize-ms');
console.log(humanize('1 hour')); // 3600000
console.log(humanize('30 seconds')); // 30000

Other packages similar to humanize-ms

Readme

Source

humanize-ms

NPM version build status Test coverage Gittip David deps

transform humanize time to ms

Installation

$ npm install humanize-ms

Examples

var ms = require('humanize-ms');

ms('1s') // 1000
ms(1000) // 1000

License

MIT

Keywords

FAQs

Package last updated on 19 May 2017

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc