diff options
author | Andrew Kelley <superjoe30@gmail.com> | 2018-10-21 13:18:53 -0300 |
---|---|---|
committer | Felipe Sateler <fsateler@debian.org> | 2018-10-21 13:18:53 -0300 |
commit | af22f1795b56b6e8628eac7b97ba9f3d91dacc72 (patch) | |
tree | 8b05e979d053ff47ffde0718cd3cc49bc58a0237 | |
parent | 9957950a1c0c0c05619eb8b95ec8f83822cbd654 (diff) |
bundle human-size module
FTP masters rejected node-human-size on the account of it being too small,
so we bundle the module here.
Forwarded: not-needed
Gbp-Pq: Name 2050-bundle-human-size-module.patch
-rw-r--r-- | node_modules/human-size/index.js | 10 | ||||
-rw-r--r-- | node_modules/human-size/package.json | 41 |
2 files changed, 51 insertions, 0 deletions
diff --git a/node_modules/human-size/index.js b/node_modules/human-size/index.js new file mode 100644 index 0000000..288cbfd --- /dev/null +++ b/node_modules/human-size/index.js @@ -0,0 +1,10 @@ +module.exports = humanSize; + +var mags = ' KMGTPEZY'; + +function humanSize(bytes, precision) { + var magnitude = Math.min(Math.log(bytes) / Math.log(1024) | 0, mags.length - 1); + var result = bytes / Math.pow(1024, magnitude); + var suffix = mags[magnitude].trim() + 'B'; + return result.toFixed(precision) + suffix; +} diff --git a/node_modules/human-size/package.json b/node_modules/human-size/package.json new file mode 100644 index 0000000..3a97ec8 --- /dev/null +++ b/node_modules/human-size/package.json @@ -0,0 +1,41 @@ +{ + "name": "human-size", + "version": "1.1.0", + "description": "human readable file size", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "author": { + "name": "Andrew Kelley", + "email": "superjoe30@gmail.com" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/andrewrk/node-human-size.git" + }, + "bugs": { + "url": "https://github.com/andrewrk/node-human-size/issues" + }, + "_id": "human-size@1.1.0", + "dist": { + "shasum": "052562be999841c037022c20259990c56ea996f9", + "tarball": "http://registry.npmjs.org/human-size/-/human-size-1.1.0.tgz" + }, + "_from": "human-size@", + "_npmVersion": "1.3.10", + "_npmUser": { + "name": "superjoe", + "email": "superjoe30@gmail.com" + }, + "maintainers": [ + { + "name": "superjoe", + "email": "superjoe30@gmail.com" + } + ], + "directories": {}, + "_shasum": "052562be999841c037022c20259990c56ea996f9", + "_resolved": "https://registry.npmjs.org/human-size/-/human-size-1.1.0.tgz" +} |