You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

pretty-ms-cli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-ms-cli - npm Package Compare versions

Comparing version
2.0.0
to
3.0.0
+25
-15
cli.js
#!/usr/bin/env node
'use strict';
const getStdin = require('get-stdin');
const meow = require('meow');
const prettyMs = require('pretty-ms');
import process from 'node:process';
import getStdin from 'get-stdin';
import meow from 'meow';
import prettyMs from 'pretty-ms';
const cli = meow(`
Usage
$ pretty-ms <milliseconds> [--compact] [--verbose] [--sec-decimal-digits=<number>]
$ pretty-ms <milliseconds> [--compact] [--verbose] [--seconds-decimal-digits=<number>]
echo <milliseconds> | pretty-ms
Options
-c, --compact Only show the first part
-v, --verbose Use full-length units
-d, --sec-decimal-digits Number of digits to appear after the seconds decimal point
-c, --compact Only show the first part
-v, --verbose Use full-length units
-d, --seconds-decimal-digits Number of digits to appear after the seconds decimal point

@@ -24,10 +24,20 @@ Examples

~1s
$ pretty-ms 1337 --sec-decimal-digits=4
$ pretty-ms 1337 --seconds-decimal-digits=4
1.3370s
`, {
alias: {
c: 'compact',
v: 'verbose',
d: 'sec-decimal-digits'
}
importMeta: import.meta,
flags: {
compact: {
type: 'boolean',
shortFlag: 'c',
},
verbose: {
type: 'boolean',
shortFlag: 'v',
},
secondsDecimalDigits: {
type: 'boolean',
shortFlag: 'd',
},
},
});

@@ -49,3 +59,3 @@

} else {
getStdin().then(init);
init(await getStdin());
}
{
"name": "pretty-ms-cli",
"version": "2.0.0",
"description": "Convert milliseconds to a human readable string: 1337000000 → 15d 11h 23m 20s",
"license": "MIT",
"repository": "sindresorhus/pretty-ms-cli",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bin": {
"pretty-ms": "cli.js"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"cli.js"
],
"keywords": [
"cli-app",
"cli",
"pretty",
"prettify",
"human",
"humanize",
"humanized",
"readable",
"time",
"ms",
"milliseconds",
"duration",
"period",
"range",
"text",
"string",
"str",
"number"
],
"dependencies": {
"get-stdin": "^5.0.1",
"meow": "^3.5.0",
"pretty-ms": "^2.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "pretty-ms-cli",
"version": "3.0.0",
"description": "Convert milliseconds to a human readable string: 1337000000 → 15d 11h 23m 20s",
"license": "MIT",
"repository": "sindresorhus/pretty-ms-cli",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"bin": {
"pretty-ms": "./cli.js"
},
"engines": {
"node": ">=18"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"cli.js"
],
"keywords": [
"cli-app",
"cli",
"pretty",
"prettify",
"human",
"humanize",
"humanized",
"readable",
"time",
"ms",
"milliseconds",
"duration",
"period",
"range",
"text",
"string",
"number"
],
"dependencies": {
"get-stdin": "^9.0.0",
"meow": "^13.2.0",
"pretty-ms": "^9.0.0"
},
"devDependencies": {
"ava": "^6.1.2",
"execa": "^8.0.1",
"xo": "^0.58.0"
}
}

@@ -1,13 +0,11 @@

# pretty-ms-cli [![Build Status](https://travis-ci.org/sindresorhus/pretty-ms-cli.svg?branch=master)](https://travis-ci.org/sindresorhus/pretty-ms-cli)
# pretty-ms-cli
> Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
## Install
```sh
npm install --global pretty-ms-cli
```
$ npm install --global pretty-ms-cli
```
## Usage

@@ -19,9 +17,9 @@

Usage
$ pretty-ms <milliseconds> [--compact] [--verbose] [--sec-decimal-digits=<number>]
$ pretty-ms <milliseconds> [--compact] [--verbose] [--seconds-decimal-digits=<number>]
echo <milliseconds> | pretty-ms
Options
-c, --compact Only show the first part
-v, --verbose Use full-length units
-d, --sec-decimal-digits Number of digits to appear after the seconds decimal point
-c, --compact Only show the first part
-v, --verbose Use full-length units
-d, --seconds-decimal-digits Number of digits to appear after the seconds decimal point

@@ -35,14 +33,8 @@ Examples

~1s
$ pretty-ms 1337 --sec-decimal-digits=4
$ pretty-ms 1337 --seconds-decimal-digits=4
1.3370s
```
## Related
- [pretty-ms](https://github.com/sindresorhus/pretty-ms) - API for this module
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
- [pretty-ms](https://github.com/sindresorhus/pretty-ms) - API for this package

Sorry, the diff of this file is not supported yet