clean-ms
v1.0.0
Published
Convert ms to human-readable format
Downloads
3
Maintainers
Readme
⚙️ Installation
npm i clean-ms
📖 Usage
• Import
// ES6
import cleanMs from "clean-ms";
// commonjs
const cleanMs = require("clean-ms");
• Examples
console.log(cleanMs(60000)); // output: 1m
console.log(cleanMs(3600000)); // output: 1h
console.log(cleanMs(86400000)); // output: 1d
console.log(cleanMs(123456789)); // output: 1d 10h 17m 36s