Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pretty-bytes

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-bytes - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

2

index.js

@@ -23,3 +23,3 @@ 'use strict';

exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), units.length - 1);
num = (num / Math.pow(1000, exponent)).toFixed(2) * 1;
num = Number((num / Math.pow(1000, exponent)).toFixed(2));
unit = units[exponent];

@@ -26,0 +26,0 @@

{
"name": "pretty-bytes",
"version": "2.0.1",
"version": "3.0.0",
"description": "Convert bytes to a human readable string: 1337 → 1.34 kB",

@@ -12,3 +12,2 @@ "license": "MIT",

},
"bin": "cli.js",
"engines": {

@@ -18,11 +17,8 @@ "node": ">=0.10.0"

"scripts": {
"test": "mocha"
"test": "xo && ava"
},
"files": [
"index.js",
"cli.js"
"index.js"
],
"keywords": [
"cli-app",
"cli",
"pretty",

@@ -41,9 +37,8 @@ "bytes",

"dependencies": {
"get-stdin": "^4.0.1",
"meow": "^3.1.0",
"number-is-nan": "^1.0.0"
},
"devDependencies": {
"mocha": "*"
"ava": "*",
"xo": "*"
}
}

@@ -23,3 +23,3 @@ # pretty-bytes [![Build Status](https://travis-ci.org/sindresorhus/pretty-bytes.svg?branch=master)](https://travis-ci.org/sindresorhus/pretty-bytes)

```js
var prettyBytes = require('pretty-bytes');
const prettyBytes = require('pretty-bytes');

@@ -34,23 +34,9 @@ prettyBytes(1337);

## CLI
## Related
```
$ npm install --global pretty-bytes
```
- [pretty-bytes-cli](https://github.com/sindresorhus/pretty-bytes-cli) - CLI for this module
```
$ pretty-bytes --help
Usage
$ pretty-bytes <number>
$ echo <number> | pretty-bytes
Example
$ pretty-bytes 1337
1.34 kB
```
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
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