New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

humanized-duration

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

humanized-duration

Display durations in short yet human readable way.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

humanized-duration

Display durations in short yet human readable way.

How to install

npm

npm install humanized-duration

bower

bower install humanized-duration

How to use

NodeJS

var humanized_duration = require('humanized-duration');

Browser

var humanized_duration = window.humanized_duration;

Examples

humanized_duration(59 * 1000) // 59s
humanized_duration(60 * 1000) // 1m

humanized_duration((58 * 60 + 59) * 1000) // 58m 59s
humanized_duration((58 * 60 + 60) * 1000) // 59m

humanized_duration((59 * 60 + 59) * 1000) // 59m 59s
humanized_duration((59 * 60 + 60) * 1000) // 1h

humanized_duration((6 * 24 * 60 * 60 + 23 * 60 * 60 + 59 * 60 + 59) * 1000) // 6d 23h
humanized_duration((6 * 24 * 60 * 60 + 23 * 60 * 60 + 59 * 60 + 60) * 1000) // 1w

humanized_duration((5 * 24 * 60 * 60 + 23 * 60 * 60 + 59 * 60 + 59) * 1000, 3) // 5d 23h 59m
humanized_duration((6 * 24 * 60 * 60 + 23 * 60 * 60 + 59 * 60 + 59) * 1000, 4) // 6d 23h 59m 59s

Keywords

FAQs

Package last updated on 14 Dec 2015

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