{ "_args": [ [ { "raw": "hasbin@^1.2.3", "scope": null, "escapedName": "hasbin", "name": "hasbin", "rawSpec": "^1.2.3", "spec": ">=1.2.3 <2.0.0", "type": "range" }, "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/xdl" ] ], "_from": "hasbin@>=1.2.3 <2.0.0", "_id": "hasbin@1.2.3", "_inCache": true, "_location": "/hasbin", "_nodeVersion": "4.2.6", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", "tmp": "tmp/hasbin-1.2.3.tgz_1464338512214_0.787763632601127" }, "_npmUser": { "name": "rowanmanning", "email": "accounts@rowanmanning.co.uk" }, "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { "raw": "hasbin@^1.2.3", "scope": null, "escapedName": "hasbin", "name": "hasbin", "rawSpec": "^1.2.3", "spec": ">=1.2.3 <2.0.0", "type": "range" }, "_requiredBy": [ "/xdl" ], "_resolved": "https://registry.npmjs.org/hasbin/-/hasbin-1.2.3.tgz", "_shasum": "78c5926893c80215c2b568ae1fd3fcab7a2696b0", "_shrinkwrap": null, "_spec": "hasbin@^1.2.3", "_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/xdl", "author": { "name": "Nature Publishing Group" }, "bugs": { "url": "https://github.com/springernature/hasbin/issues" }, "contributors": [ { "name": "Rowan Manning", "url": "http://rowanmanning.com/" }, { "name": "Andrew Walker", "url": "http://www.moddular.org/" } ], "dependencies": { "async": "~1.5" }, "description": "Check whether a binary exists in the PATH environment variable", "devDependencies": { "istanbul": "~0.3", "jscs": "^2", "jshint": "^2", "mocha": "^2", "mockery": "~1.4", "proclaim": "^3", "sinon": "^1" }, "directories": {}, "dist": { "shasum": "78c5926893c80215c2b568ae1fd3fcab7a2696b0", "tarball": "https://registry.npmjs.org/hasbin/-/hasbin-1.2.3.tgz" }, "engines": { "node": ">=0.10" }, "gitHead": "5af037b8e28c7de6c35187e0dcc44cd2dc75e9cc", "homepage": "https://github.com/springernature/hasbin", "keywords": [ "bin", "check", "path" ], "license": "MIT", "main": "./lib/hasbin.js", "maintainers": [ { "name": "dotcode", "email": "dotcode+npm@gmail.com" }, { "name": "moddular", "email": "andy@moddular.org" }, { "name": "rowanmanning", "email": "accounts@rowanmanning.co.uk" } ], "name": "hasbin", "optionalDependencies": {}, "readme": "\nHasBin\n======\n\nCheck whether a binary exists in the `PATH` environment variable.\n\n[![NPM version][shield-npm]][info-npm]\n[![Node.js version support][shield-node]][info-node]\n[![Build status][shield-build]][info-build]\n[![Dependencies][shield-dependencies]][info-dependencies]\n[![MIT licensed][shield-license]][info-license]\n\n```js\nvar hasbin = require('hasbin');\n\n// Check if a binary exists\nhasbin('node', function (result) {\n // result === true\n});\nhasbin('wtf', function (result) {\n // result === false\n});\n\n// Check if all binaries exist\nhasbin.all(['node', 'npm'], function (result) {\n // result === true\n});\n\n// Check if at least one binary exists\nhasbin.some(['node', 'wtf'], function (result) {\n // result === true\n});\n\n// Find the first available binary\nhasbin.first(['node', 'npm'], function (result) {\n // result === 'node'\n});\n```\n\n\nTable Of Contents\n-----------------\n\n- [Install](#install)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n\nInstall\n-------\n\nInstall HasBin with [npm][npm]:\n\n```sh\nnpm install hasbin\n```\n\n\nUsage\n-----\n\n### `hasbin(binaryName, callback)`\n\nCheck whether a binary exists on one of the paths in `process.env.PATH`. Calls back with `true` if it does.\n\n```js\n// Arguments\nbinaryName = String\ncallback = Function(Boolean)\n```\n\n```js\n// Example\nhasbin('node', function (result) {\n // result === true\n});\n```\n\n### `hasbin.sync(binaryName)`\n\nSynchronous `hasbin`.\n\n```js\n// Arguments\nbinaryName = String\nreturn Boolean\n```\n\n```js\n// Example\nresult = hasbin.sync('node');\n```\n\n### `hasbin.all(binaryNames, callback)`\n\nCheck whether all of a set of binaries exist on one of the paths in `process.env.PATH`. Calls back with `true` if all of the binaries do. Aliased as `hasbin.every`.\n\n```js\n// Arguments\nbinaryNames = Array(String)\ncallback = Function(Boolean)\n```\n\n```js\n// Example\nhasbin.all(['node', 'npm'], function (result) {\n // result === true\n});\n```\n\n### `hasbin.all.sync(binaryNames)`\n\nSynchronous `hasbin.all`. Aliased as `hasbin.every.sync`.\n\n```js\n// Arguments\nbinaryNames = Array(String)\nreturn Boolean\n```\n\n```js\n// Example\nresult = hasbin.all.sync(['node', 'npm']);\n```\n\n### `hasbin.some(binaryNames, callback)`\n\nCheck whether at least one of a set of binaries exists on one of the paths in `process.env.PATH`. Calls back with `true` if at least one of the binaries does. Aliased as `hasbin.any`.\n\n```js\n// Arguments\nbinaryNames = Array(String)\ncallback = Function(Boolean)\n```\n\n```js\n// Example\nhasbin.some(['node', 'npm'], function (result) {\n // result === true\n});\n```\n\n### `hasbin.some.sync(binaryNames)`\n\nSynchronous `hasbin.some`. Aliased as `hasbin.any.sync`.\n\n```js\n// Arguments\nbinaryNames = Array(String)\nreturn Boolean\n```\n\n```js\n// Example\nresult = hasbin.some.sync(['node', 'npm']);\n```\n\n### `hasbin.first(binaryNames, callback)`\n\nChecks the list of `binaryNames` to find the first binary that exists on one of the paths in `process.env.PATH`. Calls back with the name of the first matched binary if one exists and `false` otherwise.\n\n```js\n// Arguments\nbinaryNames = Array(String)\ncallback = Function(String|false)\n```\n\n```js\n// Example\nhasbin.first(['node', 'npm'], function (result) {\n // result === 'node'\n});\n```\n\n### `hasbin.first.sync(binaryNames)`\n\nSynchronous `hasbin.first`.\n\n```js\n// Arguments\nbinaryNames = Array(String)\nreturn String|false\n```\n\n```js\n// Example\nresult = hasbin.first.sync(['node', 'npm']);\n```\n\n\nContributing\n------------\n\nTo contribute to HasBin, clone this repo locally and commit your code on a separate branch.\n\nPlease write unit tests for your code, and check that everything works by running the following before opening a pull-request:\n\n```sh\nmake ci\n```\n\n\nLicense\n-------\n\nHasBin is licensed under the [MIT][info-license] license. \nCopyright © 2015, Springer Nature\n\n\n\n[npm]: https://npmjs.org/\n[info-coverage]: https://coveralls.io/github/springernature/hasbin\n[info-dependencies]: https://gemnasium.com/springernature/hasbin\n[info-license]: LICENSE\n[info-node]: package.json\n[info-npm]: https://www.npmjs.com/package/hasbin\n[info-build]: https://travis-ci.org/springernature/hasbin\n[shield-coverage]: https://img.shields.io/coveralls/springernature/hasbin.svg\n[shield-dependencies]: https://img.shields.io/gemnasium/springernature/hasbin.svg\n[shield-license]: https://img.shields.io/badge/license-MIT-blue.svg\n[shield-node]: https://img.shields.io/badge/node.js%20support-0.10–6-brightgreen.svg\n[shield-npm]: https://img.shields.io/npm/v/hasbin.svg\n[shield-build]: https://img.shields.io/travis/springernature/hasbin/master.svg\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/springernature/hasbin.git" }, "scripts": { "test": "make ci" }, "version": "1.2.3" }