Profile Picture

This commit is contained in:
SowinskiBraeden committed 2020-11-30 10:25:40 -08:00
1 parent 867770e14e
commit 43f662982e
365 files changed
+45560 -167

No files matched your search

+5
View File
@@ -1,3 +1,8 @@
3.1.0 / 2019-01-22
==================
* Add petabyte (`pb`) support
3.0.0 / 2017-08-31
==================
+9 -8
View File
@@ -83,6 +83,7 @@ Supported units and abbreviations are as follows and are case-insensitive:
* `mb` for megabytes
* `gb` for gigabytes
* `tb` for terabytes
* `pb` for petabytes
The units are in powers of two, not ten. This means 1kb = 1024b according to this parser.
@@ -108,18 +109,18 @@ bytes('1024');
// output: 1024
bytes(1024);
// output: 1024
// output: 1KB
```
## License
[MIT](LICENSE)
[downloads-image]: https://img.shields.io/npm/dm/bytes.svg
[downloads-url]: https://npmjs.org/package/bytes
[npm-image]: https://img.shields.io/npm/v/bytes.svg
[npm-url]: https://npmjs.org/package/bytes
[travis-image]: https://img.shields.io/travis/visionmedia/bytes.js/master.svg
[travis-url]: https://travis-ci.org/visionmedia/bytes.js
[coveralls-image]: https://img.shields.io/coveralls/visionmedia/bytes.js/master.svg
[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master
[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master
[downloads-image]: https://badgen.net/npm/dm/bytes
[downloads-url]: https://npmjs.org/package/bytes
[npm-image]: https://badgen.net/npm/node/bytes
[npm-url]: https://npmjs.org/package/bytes
[travis-image]: https://badgen.net/travis/visionmedia/bytes.js/master
[travis-url]: https://travis-ci.org/visionmedia/bytes.js
+6 -3
View File
@@ -30,10 +30,11 @@ var map = {
kb: 1 << 10,
mb: 1 << 20,
gb: 1 << 30,
tb: ((1 << 30) * 1024)
tb: Math.pow(1024, 4),
pb: Math.pow(1024, 5),
};
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i;
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
/**
* Convert the given value in bytes into a string or parse to string to an integer in bytes.
@@ -93,7 +94,9 @@ function format(value, options) {
var unit = (options && options.unit) || '';
if (!unit || !map[unit.toLowerCase()]) {
if (mag >= map.tb) {
if (mag >= map.pb) {
unit = 'PB';
} else if (mag >= map.tb) {
unit = 'TB';
} else if (mag >= map.gb) {
unit = 'GB';
+17 -18
View File
@@ -1,33 +1,28 @@
{
"_args": [
[
"bytes@3.0.0",
"C:\\Users\\flami\\OneDrive\\Desktop\\node_passport_login"
]
],
"_from": "bytes@3.0.0",
"_id": "bytes@3.0.0",
"_from": "bytes@3.1.0",
"_id": "bytes@3.1.0",
"_inBundle": false,
"_integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=",
"_integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==",
"_location": "/bytes",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "bytes@3.0.0",
"raw": "bytes@3.1.0",
"name": "bytes",
"escapedName": "bytes",
"rawSpec": "3.0.0",
"rawSpec": "3.1.0",
"saveSpec": null,
"fetchSpec": "3.0.0"
"fetchSpec": "3.1.0"
},
"_requiredBy": [
"/body-parser",
"/raw-body"
],
"_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
"_spec": "3.0.0",
"_where": "C:\\Users\\flami\\OneDrive\\Desktop\\node_passport_login",
"_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"_shasum": "f6cf7933a360e0588fa9fde85651cdc7f805d1f6",
"_spec": "bytes@3.1.0",
"_where": "C:\\Users\\flami\\OneDrive\\Desktop\\Projects\\XP-System\\node_modules\\body-parser",
"author": {
"name": "TJ Holowaychuk",
"email": "tj@vision-media.ca",
@@ -36,6 +31,7 @@
"bugs": {
"url": "https://github.com/visionmedia/bytes.js/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jed Watson",
@@ -46,10 +42,12 @@
"email": "theo.fidry@gmail.com"
}
],
"deprecated": false,
"description": "Utility to parse a string bytes to bytes and vice-versa",
"devDependencies": {
"mocha": "2.5.3",
"nyc": "10.3.2"
"eslint": "5.12.1",
"mocha": "5.2.0",
"nyc": "13.1.0"
},
"engines": {
"node": ">= 0.8"
@@ -77,9 +75,10 @@
"url": "git+https://github.com/visionmedia/bytes.js.git"
},
"scripts": {
"lint": "eslint .",
"test": "mocha --check-leaks --reporter spec",
"test-ci": "nyc --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test"
},
"version": "3.0.0"
"version": "3.1.0"
}