Socket
Book a DemoInstallSign in
Socket

length

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

length

Time lengths for humans

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

length–Time lengths for humans Build Status

Time Types

MillisecondsUnit
31560000y, year, years
2629740mo, month, months
86400d, day, days
3600h, hour, hours
60m, minute, minutes
1s, sec, second, seconds
0.001ms, millisecond, milliseconds
0.000001us, microsecond, microseconds

Downloads

Tested to work against Internet Explorer 6+, Safari 3+, Google Chrome 1+, Firefox 3+, and Opera 10+!

Development Version (0.0.1) — 1.4 KiB, uncompressed with comments.

Production Version (0.0.1) — 424 bytes, minified and gzipped.

var num = length(number, [to])

Parameter: number

  • number — This may either be a string, or a number. If it's a string with no type, it's assumed to be in the to format.
  • Optional to — The format to interval to return, defaults to 'ms'.
length('0.5s') === 500;
length('1h', 's') === 3600;
length(10, 's') === 10;
length('2 days', 'h') === 48;

License

MIT

Keywords

time

FAQs

Package last updated on 27 Jan 2013

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