{
  "name": "bytes",
  "description": "Utility to parse a string bytes to bytes and vice-versa",
  "version": "2.1.0",
  "author": {
    "name": "TJ Holowaychuk",
    "email": "tj@vision-media.ca",
    "url": "http://tjholowaychuk.com"
  },
  "contributors": [
    {
      "name": "Jed Watson",
      "email": "jed.watson@me.com"
    }
  ],
  "license": "MIT",
  "keywords": [
    "byte",
    "bytes",
    "utility",
    "parse",
    "parser",
    "convert",
    "converter"
  ],
  "repository": {
    "type": "git",
    "url": "visionmedia/bytes.js"
  },
  "component": {
    "scripts": {
      "bytes/index.js": "index.js"
    }
  },
  "devDependencies": {
    "mocha": "*"
  },
  "files": [
    "History.md",
    "LICENSE",
    "Readme.md",
    "index.js"
  ],
  "scripts": {
    "test": "mocha --check-leaks --reporter spec"
  },
  "readme": "# Bytes utility\n\nUtility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa.\n\n## Usage\n\n```js\nvar bytes = require('bytes');\n```\n\n#### bytes.format(number value, [options]): string|null\n\nFormat the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is\n rounded.\n\n**Arguments**\n\n| Name    | Type   | Description        |\n|---------|--------|--------------------|\n| value   | `number` | Value in bytes     |\n| options | `Object` | Conversion options |\n\n**Options**\n\n| Property          | Type   | Description                                                                             |\n|-------------------|--------|-----------------------------------------------------------------------------------------|\n| thousandsSeparator | `string`&#124;`null` | Example of values: `' '`, `','` and `.`... Default value to `' '`. |\n\n**Returns**\n\n| Name    | Type        | Description             |\n|---------|-------------|-------------------------|\n| results | `string`&#124;`null` | Return null upon error. String value otherwise. |\n\n**Example**\n\n```js\nbytes(1024);\n// output: '1kB'\n\nbytes(1000);\n// output: '1000B'\n\nbytes(1000, {thousandsSeparator: ' '});\n// output: '1 000B'\n```\n\n#### bytes.parse(string value): number|null\n\nParse the string value into an integer in bytes. If no unit is given, it is assumed the value is in bytes.\n\n**Arguments**\n\n| Name          | Type   | Description        |\n|---------------|--------|--------------------|\n| value   | `string` | String to parse.   |\n\n**Returns**\n\n| Name    | Type        | Description             |\n|---------|-------------|-------------------------|\n| results | `number`&#124;`null` | Return null upon error. Value in bytes otherwise. |\n\n**Example**\n\n```js\nbytes('1kB');\n// output: 1024\n\nbytes('1024');\n// output: 1024\n```\n\n## Installation\n\n```bash\nnpm install bytes --save\ncomponent install visionmedia/bytes.js\n```\n\n## License \n\n[![npm](https://img.shields.io/npm/l/express.svg)](https://github.com/visionmedia/bytes.js/blob/master/LICENSE)\n",
  "readmeFilename": "Readme.md",
  "_id": "bytes@2.1.0",
  "dist": {
    "shasum": "7bf95dd1c41ce8549e31e544f6405906d8bc02bf"
  },
  "_from": "bytes@2.1.0",
  "_resolved": "https://registry.npmjs.org/bytes/-/bytes-2.1.0.tgz"
}
