
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
A node micro library for converting millis into a human friendly format.
Prettytime is a micro library for converting millis (e.g. prettytime(2342)
) into a human friendly format (e.g. 2.3 seconds
).
$ npm install prettytime
var prettytime = require('prettytime');
var now = Date.now();
...
prettytime(now - Date.now());
// => 2.3 seconds
prettytime(100); // => 100 ms
prettytime(1000); // => 1 second
prettytime(5000); // => 5 seconds
prettytime(60000); // => 1 minute
prettytime(3600000); // => 1 hour
Allows you to set the decimal limit of the returned values, always rounded to the nearest significant decimal
prettytime(1236, { decimals: 1 }); // => 1.2 seconds
prettytime(1236, { decimals: 2 }); // => 1.24 seconds
Converts the time type to a short string.
Full | Short |
---|---|
year | y |
month | mo |
day | d |
hour | h |
minute | m |
second | s |
ms | ms |
prettytime(100, { short: true}); // => 100 ms
prettytime(1000, { short: true}); // => 1 s
prettytime(60000, { short: true}); // => 1 m
prettytime(3600000, { short: true}); // => 1 h
MIT © Jason Wilson
FAQs
A node micro library for converting millis into a human friendly format.
The npm package prettytime receives a total of 3 weekly downloads. As such, prettytime popularity was classified as not popular.
We found that prettytime demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.