Turn millisecond durations into human-readable strings.
humanizeDuration(3000)
// => "3 seconds"
humanizeDuration(2250)
// => "2.25 seconds"
humanizeDuration(97320000)
// => "1 day, 3 hours, 2 minutes"
In the browser:
<script src="humanize-duration.js"></script>
<script>
humanizeDuration(12000);
</script>
In Node (or Browserify or Webpack or anywhere with CommonJS):
const humanizeDuration = require("humanize-duration");
humanizeDuration(12000);
See the README for more.