{
  "_args": [
    [
      {
        "raw": "isbinaryfile@^3.0.0",
        "scope": null,
        "escapedName": "isbinaryfile",
        "name": "isbinaryfile",
        "rawSpec": "^3.0.0",
        "spec": ">=3.0.0 <4.0.0",
        "type": "range"
      },
      "/home/travis/build/lukesargeant/ember-sparkline/node_modules/ember-cli"
    ]
  ],
  "_from": "isbinaryfile@>=3.0.0 <4.0.0",
  "_id": "isbinaryfile@3.0.2",
  "_inCache": true,
  "_location": "/isbinaryfile",
  "_nodeVersion": "7.0.0",
  "_npmOperationalInternal": {
    "host": "packages-12-west.internal.npmjs.com",
    "tmp": "tmp/isbinaryfile-3.0.2.tgz_1483387062557_0.10704225953668356"
  },
  "_npmUser": {
    "name": "gjtorikian",
    "email": "gjtorikian@gmail.com"
  },
  "_npmVersion": "3.10.8",
  "_phantomChildren": {},
  "_requested": {
    "raw": "isbinaryfile@^3.0.0",
    "scope": null,
    "escapedName": "isbinaryfile",
    "name": "isbinaryfile",
    "rawSpec": "^3.0.0",
    "spec": ">=3.0.0 <4.0.0",
    "type": "range"
  },
  "_requiredBy": [
    "/ember-cli"
  ],
  "_resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.2.tgz",
  "_shasum": "4a3e974ec0cba9004d3fc6cde7209ea69368a621",
  "_shrinkwrap": null,
  "_spec": "isbinaryfile@^3.0.0",
  "_where": "/home/travis/build/lukesargeant/ember-sparkline/node_modules/ember-cli",
  "bugs": {
    "url": "https://github.com/gjtorikian/isBinaryFile/issues"
  },
  "dependencies": {},
  "description": "Detects if a file is binary in Node.js. Similar to Perl's -B.",
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-cli": "~0.1.13",
    "grunt-exec": "0.4.3",
    "grunt-release": "~0.6.0",
    "mocha": "^2.2.4"
  },
  "directories": {},
  "dist": {
    "shasum": "4a3e974ec0cba9004d3fc6cde7209ea69368a621",
    "tarball": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.2.tgz"
  },
  "engines": {
    "node": ">=0.6.0"
  },
  "files": [
    "index.js"
  ],
  "gitHead": "e5262cf43088319833993dcf8dc797112d303cae",
  "homepage": "https://github.com/gjtorikian/isBinaryFile#readme",
  "license": "MIT",
  "main": "./index.js",
  "maintainers": [
    {
      "name": "Garen J. Torikian",
      "email": "gjtorikian@gmail.com"
    }
  ],
  "name": "isbinaryfile",
  "optionalDependencies": {},
  "readme": "# isBinaryFile\n\nDetects if a file is binary in Node.js. Similar to [Perl's `-B` switch](http://stackoverflow.com/questions/899206/how-does-perl-know-a-file-is-binary), in that:\n- it reads the first few thousand bytes of a file\n- checks for a `null` byte; if it's found, it's binary\n- flags non-ASCII characters. After a certain number of \"weird\" characters, the file is flagged as binary\n\nMuch of the logic is pretty much ported from [ag](https://github.com/ggreer/the_silver_searcher).\n\nNote: if the file doesn't exist, is a directory, or is empty, the function returns `false`.\n\n## Installation\n\n```\nnpm install isbinaryfile\n```\n\n## Usage\n\n### isBinaryFile(filepath, callback)\n\n* `filepath`, a `string` indicating the path to the file.\n* `callback`, a `function` for the callback. It has two arguments:\n  - `err`, the typical Node.js error argument\n  - `result`, a `boolean` of `true` or `false`, depending on if the file is binary\n\n\n### isBinaryFile(bytes, size, callback)\n\n* `bytes`, a `Buffer` of the file's contents.\n* `size`, an optional `number` indicating the file size.\n* `callback`, a `function` for the callback. It has two arguments:\n  - `err`, the typical Node.js error argument\n  - `result`, a `boolean` of `true` or `false`, depending on if the file is binary\n\n\n### isBinaryFile.sync(filepath)\n\n* `filepath`, a `string` indicating the path to the file.\n\n\n### isBinaryFile.sync(bytes, size)\n\n* `bytes`, a `Buffer` of the file's contents.\n* `size`, an `number` indicating the file size.\n\n\nReturns a `boolean` of `true` or `false`, depending on if the file is binary.\n\n### Examples\n\n```javascript\nvar isBinaryFile = require(\"isbinaryfile\");\n\nfs.readFile(\"some_file\", function(err, data) {\n  fs.lstat(\"some_file\", function(err, stat) {\n    isBinaryFile(data, stat.size, function (err, result) {\n      if (!err) {\n        if (result) {\n          console.log(\"It is!\")\n        }\n        else {\n          console.log(\"No.\")\n        }\n      }\n    });\n  });\n});\n\nisBinaryFile.sync(\"some_file\"); // true or false\nvar bytes = fs.readFileSync((\"some_file\"));\nvar size = fs.lstatSync((\"some_file\").size;\nisBinaryFile.sync(bytes, size); // true or false\n```\n\n## Testing\n\nRun `npm install` to install `mocha`, then run `npm test`.\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/gjtorikian/isBinaryFile.git"
  },
  "scripts": {
    "test": "mocha"
  },
  "version": "3.0.2"
}
