{"name":"browser-or-node","version":"2.1.1","description":"Check where the code is running in the browser or node.js","main":"./lib/index.js","types":"./lib/index.d.ts","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 node_modules/mocha/bin/_mocha -- --require babel-core/register --recursive","lint":"eslint src","build":"cross-env BABEL_ENV=commonjs babel src --out-dir lib --copy-files","prepublish":"npm run clean && npm run lint && npm run test && npm run build"},"repository":{"type":"git","url":"git+https://github.com/flexdinesh/browser-or-node.git"},"keywords":["npm","browser","node","is browser","is node","is browser node"],"author":{"name":"Dineshkumar Pandiyan","email":"flexdinesh@gmail.com"},"contributors":[{"name":"Daniel Wang","email":"daniel.liberated@gmail.com","url":"https://github.com/dan1wang/"}],"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":"^10.1.0","babel-plugin-add-module-exports":"^1.0.2","babel-preset-es2015":"^6.24.1","babel-preset-stage-2":"^6.24.1","chai":"^4.2.0","cross-env":"^7.0.2","eslint":"^7.3.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.21.2","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.0","istanbul":"^1.0.0-alpha","mocha":"^8.0.1","rimraf":"^3.0.2"},"gitHead":"9875469e69b0dbc6a35e50b104495facf869bb4a","_id":"browser-or-node@2.1.1","_nodeVersion":"14.20.0","_npmVersion":"6.14.17","dist":{"integrity":"sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg==","shasum":"738790b3a86a8fc020193fa581273fbe65eaea0f","tarball":"http://registry-npm.ywwl.com/browser-or-node/download/browser-or-node-2.1.1.tgz","fileCount":7,"unpackedSize":6807,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpzIJX7iVpssJ3tRvVwbzxZdhs1e3NUx80FaE14NiiTQIhAJ5Lt3e3kfSeHY2qSgDWgnVJlQbJnYVk5TSsLtw2OkML"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiTImACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOghAAojkSZuhPIbSHcrAQLXnYfepSNhh5FKQ6GeP3iB8hYZbDF8GP\r\nSs0z9OIb4xwZQJ3DVJ5H9SntxLYA9QpcYQj7qXz+QzNl88Mgjz5GF490Ypvh\r\nh7YjhnKhy2QxHCvizt13Otj8LsUQX/8A0zMS+d93zv/iv4EMpuBa06I7n907\r\nRfjxO+l8ijOhbQAJQcXpLNiXy2ZiaegUfd8/3bG5f/97kEDeM/Q2m1z2mrAc\r\nsmbmddYp4SI3Z3DVQ8m0agWjziBnNZCnrV80Qcm8EsXdWiDNTlKEO12EAOTo\r\nbAUpVIofwBpEV/jpKQLUvqFjgL9asT4ruVQvYIHbywOSVAQzxL2ZpAqyVvBT\r\nrGNdi4jGum3IFyk2yHXlQGw6uHg6ttxf1tb6dK0qlN2GIfO7c4dAFZtfLGay\r\nVFoN8o1uIFv9V+8p1vDSVXqZHSw8yKbKivK8lLYddpx2JOH4oTs/3z8ATUHO\r\n+TrC4z1uOIkIcbISym6a0otiJAciGDliSf8JO4BO+/xwL3xOsWRcPq3vHTdm\r\ni2Hc15MDYjwppw2ORVnjs6hNxWHG2ysEWrMFcIU8LqUxrnEq2wveelEpL0xT\r\nPTsuYl7auP31MIl6i+sznVQLXb+YvPK8MVmBpx+icXOdEA4qHZBX23Y7dqW1\r\nhujPd/JCrlmcdFb//wWl8NkMsmCL1GF3YX0=\r\n=GaGA\r\n-----END PGP SIGNATURE-----\r\n","size":2656,"noattachment":false,"key":"/browser-or-node/-/browser-or-node-2.1.1.tgz"},"_npmUser":{"name":"flexdinesh","email":"flexdinesh@gmail.com"},"directories":{},"maintainers":[{"name":"flexdinesh","email":"flexdinesh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/browser-or-node_2.1.1_1669935654223_0.9956188040876126"},"_hasShrinkwrap":false,"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":1669935654407,"_cnpm_publish_time":1669935654407,"dist-tags":{"latest":"3.0.0"}}