{"name":"browser-or-node","version":"1.0.1","description":"Check where the code is running in the browser or node.js","main":"./lib/index.js","scripts":{"clean":"rimraf lib","test":"npm run cover","test:only":"cross-env BABEL_ENV=commonjs mocha --require babel-core/register --recursive","test:watch":"npm test -- --watch","test:examples":"node examples/","cover":"cross-env BABEL_ENV=commonjs istanbul cover _mocha -- --require babel-core/register --recursive","lint":"eslint src test","build":"cross-env BABEL_ENV=commonjs babel src --out-dir lib","prepublish":"npm run clean && npm run lint && npm run test && npm run build"},"files":["lib","src"],"repository":{"type":"git","url":"git+https://github.com/flexdinesh/browser-or-node.git"},"keywords":["npm","module","node","javascript","package json","package.json","get package json"],"author":{"name":"Dineshkumar Pandiyan","email":"flexdinesh@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/flexdinesh/browser-or-node/issues"},"homepage":"https://github.com/flexdinesh/browser-or-node#readme","devDependencies":{"babel":"^6.23.0","babel-cli":"^6.26.0","babel-eslint":"^8.2.1","babel-plugin-add-module-exports":"^0.2.1","babel-preset-es2015":"^6.24.1","babel-preset-stage-2":"^6.24.1","chai":"^4.1.2","cross-env":"^5.1.3","eslint":"^4.16.0","eslint-config-airbnb":"^16.1.0","eslint-plugin-import":"^2.7.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-react":"^7.4.0","istanbul":"^1.0.0-alpha","mocha":"^5.0.0","rimraf":"^2.6.2"},"gitHead":"abe834c9634c869b90b6a010405671dd925617a6","_id":"browser-or-node@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"flexdinesh","email":"flexdinesh@gmail.com"},"maintainers":[{"name":"flexdinesh","email":"flexdinesh@gmail.com"}],"dist":{"integrity":"sha512-g8Lb1sPXfErVHIPGxAqr9dbQP69s9FDKYwkzDh5KfJE6DpNaeDT6Zgvl3AqH4ooZxMhc2Dypl6Q39k6vDHyTUA==","shasum":"caba6902d4e46c18cc40f5117ab54a593f805058","tarball":"http://registry-npm.ywwl.com/browser-or-node/download/browser-or-node-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFWU21z5yMq3njBFueL6CpxcuCLjw7yFvRCE/KrpA6uQAiBSAcHvG/zfDBYVE7q2FwKuQNMz4Mdj1I57W4R1WnAd1g=="}],"size":2090,"noattachment":false,"key":"/browser-or-node/-/browser-or-node-1.0.1.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/browser-or-node-1.0.1.tgz_1516819856079_0.4700031748507172"},"directories":{},"readme":"# Browser or Node.js\n\n[![npm version](https://badge.fury.io/js/browser-or-node.svg)](https://www.npmjs.com/package/browser-or-node)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nCheck in which environment the code is running - browser/node.js/webworker/jsdom/deno.\n\n\n\n> [!NOTE]\n> To help release v3.0.0, please try [v3.0.0-pre.0](https://github.com/flexdinesh/browser-or-node/releases/tag/3.0.0-pre.0) and let us know if you run into issues.\n\n## Install\n\n```\n$ npm install --save browser-or-node\n```\n\n## Usage\n\nImport the checks and use it in your code. Works with both ESM and CJS imports.\n\n```js\nimport * as jsEnv from \"browser-or-node\";\n// import { isBrowser, isNode, isWebWorker, isJsDom, isDeno, isBun } from \"browser-or-node\";\n// const jsEnv = require(\"browser-or-node\");\n\nif (jsEnv.isBrowser) {\n  // do browser only stuff\n}\n\nif (jsEnv.isNode) {\n  // do node.js only stuff\n}\n\nif (jsEnv.isWebWorker) {\n  // do web worker only stuff\n}\n\nif (jsEnv.isJsDom) {\n  // do jsdom only stuff\n}\n\nif (jsEnv.isDeno) {\n  // do deno only stuff\n}\n\nif (jsEnv.isBun) {\n  // do bun only stuff\n}\n```\n\n## License\n\nMIT © Dinesh Pandiyan\n","publish_time":1516819856938,"_cnpm_publish_time":1516819856938,"dist-tags":{"latest":"3.0.0"}}