human-format
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -50,3 +50,3 @@ // UMD: https://github.com/umdjs/umd/blob/master/returnExports.js | ||
function escapeRegexp (str) { | ||
return str.replace(/([.*+?=^!:${}()|[\]\/\\])/g, '\\$1') | ||
return str.replace(/([.*+?=^!:${}()|[\]/\\])/g, '\\$1') | ||
} | ||
@@ -154,6 +154,4 @@ | ||
var prefixes = {} | ||
var factor = initExp ? Math.pow(base, initExp) : 1 | ||
forEach(prefixesList, function (prefix, i) { | ||
prefixes[prefix] = Math.pow(base, i + (initExp || 0)) | ||
factor *= base | ||
}) | ||
@@ -160,0 +158,0 @@ |
{ | ||
"name": "human-format", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "Converts a number to/from a human readable string: `1337` ↔ `1.34kB`", | ||
@@ -19,17 +19,26 @@ "keywords": [ | ||
"scripts": { | ||
"lint": "standard", | ||
"test": "npm run lint && mocha index.spec.js" | ||
"commitmsg": "yarn test", | ||
"dev-test": "jest --watch", | ||
"prepublish": "mkdir -p dist && browserify -s humanFormat index.js | uglifyjs -c > dist/human-format.js", | ||
"pretest": "standard", | ||
"test": "jest" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/julien-f/human-format" | ||
"url": "http://github.com/JsCommunity/human-format" | ||
}, | ||
"bugs": "https://github.com/julien-f/human-format/issues", | ||
"bugs": "https://github.com/JsCommunity/human-format/issues", | ||
"author": "Julien Fontanet <julien.fontanet@isonoe.net> (http://julien.isonoe.net/)", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"chai": "^3.0.0", | ||
"mocha": "^2.2.5", | ||
"standard": "^5.1.0" | ||
} | ||
"browserify": "^14.1.0", | ||
"husky": "^0.13.1", | ||
"jest": "^19.0.2", | ||
"standard": "^9.0.0", | ||
"uglify-js": "^2.8.3" | ||
}, | ||
"files": [ | ||
"dist/", | ||
"index.js" | ||
] | ||
} |
# human-format | ||
[![Build Status](https://img.shields.io/travis/julien-f/human-format/master.svg)](http://travis-ci.org/julien-f/human-format) | ||
[![Dependency Status](https://david-dm.org/julien-f/human-format/status.svg?theme=shields.io)](https://david-dm.org/julien-f/human-format) | ||
[![devDependency Status](https://david-dm.org/julien-f/human-format/dev-status.svg?theme=shields.io)](https://david-dm.org/julien-f/human-format#info=devDependencies) | ||
[![Build Status](https://img.shields.io/travis/JsCommunity/human-format/master.svg)](http://travis-ci.org/JsCommunity/human-format) | ||
[![Dependency Status](https://david-dm.org/JsCommunity/human-format/status.svg?theme=shields.io)](https://david-dm.org/JsCommunity/human-format) | ||
[![devDependency Status](https://david-dm.org/JsCommunity/human-format/dev-status.svg?theme=shields.io)](https://david-dm.org/JsCommunity/human-format#info=devDependencies) | ||
@@ -10,16 +10,24 @@ > Converts a number to/from a human readable string: `1337` ↔ `1.34kB` | ||
## Install | ||
## Installation | ||
Download [manually](https://github.com/julien-f/human-format/releases) or with package-manager. | ||
### Node & [Browserify](http://browserify.org/)/[Webpack](https://webpack.js.org/) | ||
#### [npm](https://npmjs.org/package/human-format) | ||
Installation of the [npm package](https://npmjs.org/package/human-format): | ||
``` | ||
npm install --save human-format | ||
> npm install --save human-format | ||
``` | ||
#### bower | ||
Then require the package: | ||
```javascript | ||
var humanFormat = require('human-format'); | ||
``` | ||
bower install --save human-format | ||
### Browser | ||
You can directly use the build provided at [unpkg.com](https://unpkg.com): | ||
```html | ||
<script src="https://unpkg.com/human-format@0.8/dist/human-format.js"></script> | ||
``` | ||
@@ -104,3 +112,3 @@ | ||
- report any [issue](https://github.com/julien-f/human-format/issues) | ||
- report any [issue](https://github.com/JsCommunity/human-format/issues) | ||
you've encountered; | ||
@@ -107,0 +115,0 @@ - fork and create a pull request. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
17492
125
5
5
300
3
2