{"_id":"esnextguardian","_rev":"97391","name":"esnextguardian","description":"Load your ES6+ files if the user's environment supports it, otherwise gracefully fallback to your ES5 files.","dist-tags":{"latest":"1.2.1"},"maintainers":[{"name":"bevryme","email":""}],"time":{"modified":"2021-06-03T10:32:43.000Z","created":"2015-09-18T04:21:16.341Z","1.2.1":"2016-01-15T03:42:07.484Z","1.2.0":"2015-12-09T05:04:27.907Z","1.1.0":"2015-09-19T13:02:51.076Z","1.0.2":"2015-09-18T05:04:52.730Z","1.0.1":"2015-09-18T04:31:15.118Z","1.0.0":"2015-09-18T04:21:16.341Z"},"users":{},"author":{"name":"2015+ Bevry Pty Ltd","email":"us@bevry.me","url":"http://bevry.me"},"repository":{"type":"git","url":"git+ssh://git@github.com/bevry/esnextguardian.git"},"versions":{"1.2.1":{"title":"ESNextGuardian","name":"esnextguardian","version":"1.2.1","description":"Load your ES6+ files if the user's environment supports it, otherwise gracefully fallback to your ES5 files.","homepage":"https://github.com/bevry/esnextguardian","license":"MIT","keywords":["es6","es6+","esnext","es2015","es2015+","es2016","es7","es5","babel"],"badges":{"list":["travisci","npmversion","npmdownloads","daviddm","daviddmdev","---","slackin","patreon","gratipay","flattr","paypal","bitcoin","wishlist"],"config":{"patreonUsername":"bevry","gratipayUsername":"bevry","flattrUsername":"balupton","paypalURL":"https://bevry.me/paypal","bitcoinURL":"https://bevry.me/bitcoin","wishlistURL":"https://bevry.me/wishlist","slackinURL":"https://slack.bevry.me"}},"author":{"name":"2015+ Bevry Pty Ltd","email":"us@bevry.me","url":"http://bevry.me"},"maintainers":[{"name":"bevryme","email":""}],"contributors":[{"name":"Benjamin Lupton","email":"b@lupton.cc","url":"http://balupton.com"}],"bugs":{"url":"https://github.com/bevry/esnextguardian/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/bevry/esnextguardian.git"},"browsers":true,"engines":{"node":">=0.10"},"dependencies":{},"devDependencies":{"assert-helpers":"^4.0.1","eslint":"^1.10.2","joe":"^1.6.0","joe-reporter-console":"^1.2.1","projectz":"^1.0.7","semver":"^5.1.0"},"main":"./lib/index.js","scripts":{"clean":"node --harmony nakefile.js clean","setup":"node --harmony nakefile.js setup","compile":"node --harmony nakefile.js compile","watch":"node --harmony nakefile.js watch","verify":"node --harmony nakefile.js verify","meta":"node --harmony nakefile.js meta","prepare":"node --harmony nakefile.js prepare","release":"node --harmony nakefile.js release","test":"node --harmony ./test/index-test.js"},"gitHead":"817b55d4449cc2f8cb6d2a9fb96d6d6f71ae2ca6","_id":"esnextguardian@1.2.1","_shasum":"eb0f1b594e2e2189ff24929cc60fea3a98693b05","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.4.1","_npmUser":{"name":"balupton","email":"b@lupton.cc"},"dist":{"shasum":"eb0f1b594e2e2189ff24929cc60fea3a98693b05","size":12041,"noattachment":false,"key":"/esnextguardian/-/esnextguardian-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/esnextguardian/download/esnextguardian-1.2.1.tgz"},"directories":{},"publish_time":1452829327484,"_cnpm_publish_time":1452829327484,"_hasShrinkwrap":false},"1.2.0":{"title":"ESNextGuardian","name":"esnextguardian","version":"1.2.0","description":"Load your ES6+ files if the user's environment supports it, otherwise gracefully fallback to your ES5 files.","homepage":"https://github.com/bevry/esnextguardian","license":"MIT","keywords":["es6","es6+","esnext","es2015","es2015+","es2016","es7","es5","babel"],"badges":{"list":["travisci","npmversion","npmdownloads","daviddm","daviddmdev","---","slackin","patreon","gratipay","flattr","paypal","bitcoin","wishlist"],"config":{"patreonUsername":"bevry","gratipayUsername":"bevry","flattrCode":"344188/balupton-on-Flattr","paypalButtonID":"QB8GQPZAH84N6","bitcoinURL":"https://bevry.me/bitcoin","wishlistURL":"https://bevry.me/wishlist","slackinURL":"https://slack.bevry.me"}},"author":{"name":"2015+ Bevry Pty Ltd","email":"us@bevry.me","url":"http://bevry.me"},"maintainers":[{"name":"bevryme","email":""}],"contributors":[{"name":"Benjamin Lupton","email":"b@lupton.cc","url":"http://balupton.com"}],"bugs":{"url":"https://github.com/bevry/esnextguardian/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/bevry/esnextguardian.git"},"browsers":true,"engines":{"node":">=0.10"},"dependencies":{},"devDependencies":{"assert-helpers":"^4.0.1","eslint":"^1.10.2","joe":"^1.6.0","joe-reporter-console":"^1.2.1","projectz":"^1.0.7"},"main":"./lib/index.js","scripts":{"clean":"node --harmony nakefile.js clean","setup":"node --harmony nakefile.js setup","compile":"node --harmony nakefile.js compile","watch":"node --harmony nakefile.js watch","verify":"node --harmony nakefile.js verify","meta":"node --harmony nakefile.js meta","prepare":"node --harmony nakefile.js prepare","release":"node --harmony nakefile.js release","test":"node --harmony ./test/index-test.js"},"gitHead":"6d28dd3854bf0481609cb822b26536f57dc3646e","_id":"esnextguardian@1.2.0","_shasum":"4f666e26aabc5fb41464aa1994db9159d1019d2d","_from":".","_npmVersion":"3.5.0","_nodeVersion":"5.1.0","_npmUser":{"name":"balupton","email":"b@lupton.cc"},"dist":{"shasum":"4f666e26aabc5fb41464aa1994db9159d1019d2d","size":12055,"noattachment":false,"key":"/esnextguardian/-/esnextguardian-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/esnextguardian/download/esnextguardian-1.2.0.tgz"},"directories":{},"publish_time":1449637467907,"_cnpm_publish_time":1449637467907,"_hasShrinkwrap":false},"1.1.0":{"title":"ESNextGuardian","name":"esnextguardian","version":"1.1.0","description":"Load your ES6+ files if the user's environment supports it, otherwise gracefully fallback to your ES5 files.","homepage":"https://github.com/bevry/esnextguardian","license":"MIT","keywords":["es6","es6+","esnext","es2015","es2015+","es2016","es7","es5","babel"],"badges":{"list":["travisci","npmversion","npmdownloads","daviddm","daviddmdev","---","slackin","patreon","gratipay","flattr","paypal","bitcoin","wishlist"],"config":{"patreonUsername":"bevry","gratipayUsername":"bevry","flattrCode":"344188/balupton-on-Flattr","paypalButtonID":"QB8GQPZAH84N6","bitcoinURL":"https://bevry.me/bitcoin","wishlistURL":"https://bevry.me/wishlist","slackinURL":"https://slack.bevry.me"}},"author":{"name":"2015+ Bevry Pty Ltd","email":"us@bevry.me","url":"http://bevry.me"},"maintainers":[{"name":"bevryme","email":""}],"contributors":[{"name":"Benjamin Lupton","email":"b@lupton.cc","url":"http://balupton.com"}],"bugs":{"url":"https://github.com/bevry/esnextguardian/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/bevry/esnextguardian.git"},"browsers":true,"engines":{"node":">=0.10"},"dependencies":{},"devDependencies":{"assert-helpers":"^3.0.0","babel-eslint":"^4.1.3","eslint":"^1.4.3","joe":"^1.6.0","joe-reporter-console":"^1.2.1","projectz":"^1.0.2"},"main":"./lib/index.js","scripts":{"clean":"node --harmony nakefile.js clean","setup":"node --harmony nakefile.js setup","compile":"node --harmony nakefile.js compile","watch":"node --harmony nakefile.js watch","verify":"node --harmony nakefile.js verify","meta":"node --harmony nakefile.js meta","prepare":"node --harmony nakefile.js prepare","release":"node --harmony nakefile.js release","test":"node --harmony ./test/index-test.js"},"gitHead":"9e62c3248445e8132fd969570ad384306f1f57be","_id":"esnextguardian@1.1.0","_shasum":"4e38e21885e092a2d40fdf1844c614b502b77026","_from":".","_npmVersion":"3.3.3","_nodeVersion":"4.1.0","_npmUser":{"name":"balupton","email":"b@lupton.cc"},"dist":{"shasum":"4e38e21885e092a2d40fdf1844c614b502b77026","size":5257,"noattachment":false,"key":"/esnextguardian/-/esnextguardian-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/esnextguardian/download/esnextguardian-1.1.0.tgz"},"directories":{},"publish_time":1442667771076,"_cnpm_publish_time":1442667771076,"_hasShrinkwrap":false},"1.0.2":{"title":"ESNextGuardian","name":"esnextguardian","version":"1.0.2","description":"Load your ES6+ files if the user's environment supports it, otherwise gracefully fallback to your ES5 files.","homepage":"https://github.com/bevry/esnextguardian","license":"MIT","keywords":["es6","es6+","esnext","es2015","es2015+","es2016","es7","es5","babel"],"badges":{"list":["npmversion","npmdownloads","daviddm","daviddmdev","---","slackin","patreon","gratipay","flattr","paypal","bitcoin","wishlist"],"config":{"patreonUsername":"bevry","gratipayUsername":"bevry","flattrCode":"344188/balupton-on-Flattr","paypalButtonID":"QB8GQPZAH84N6","bitcoinURL":"https://bevry.me/bitcoin","wishlistURL":"https://bevry.me/wishlist","slackinURL":"https://slack.bevry.me"}},"author":{"name":"2015+ Bevry Pty Ltd","email":"us@bevry.me","url":"http://bevry.me"},"maintainers":[{"name":"bevryme","email":""}],"contributors":[{"name":"Benjamin Lupton","email":"b@lupton.cc","url":"https://github.com/balupton"}],"bugs":{"url":"https://github.com/bevry/esnextguardian/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/bevry/esnextguardian.git"},"browsers":true,"engines":{"node":">=0.10"},"dependencies":{},"devDependencies":{"assert-helpers":"^3.0.0","babel-eslint":"^4.1.3","eslint":"^1.4.3","joe":"^1.6.0","joe-reporter-console":"^1.2.1","projectz":"^1.0.2"},"main":"./lib/index.js","scripts":{"clean":"node --harmony nakefile.js clean","setup":"node --harmony nakefile.js setup","compile":"node --harmony nakefile.js compile","watch":"node --harmony nakefile.js watch","verify":"node --harmony nakefile.js verify","meta":"node --harmony nakefile.js meta","prepare":"node --harmony nakefile.js prepare","release":"node --harmony nakefile.js release","test":"node --harmony ./test/index-test.js"},"gitHead":"ddbe848059c5ab6ff8c96ac4c18ffcdd681cf929","_id":"esnextguardian@1.0.2","_shasum":"386fb3c4b8d6d2345a1aa4ecb40835b147715644","_from":".","_npmVersion":"3.3.2","_nodeVersion":"4.0.0","_npmUser":{"name":"balupton","email":"b@lupton.cc"},"dist":{"shasum":"386fb3c4b8d6d2345a1aa4ecb40835b147715644","size":5061,"noattachment":false,"key":"/esnextguardian/-/esnextguardian-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/esnextguardian/download/esnextguardian-1.0.2.tgz"},"directories":{},"publish_time":1442552692730,"_cnpm_publish_time":1442552692730,"_hasShrinkwrap":false},"1.0.1":{"title":"ESNextGuardian","name":"esnextguardian","version":"1.0.1","description":"Load your ES6+ files if the user's environment supports it, otherwise gracefully fallback to your ES5 files.","homepage":"https://github.com/bevry/esnextguardian","license":"MIT","keywords":["es6","es6+","esnext","es2015","es2015+","es2016","es7","es5","babel"],"badges":{"list":["npmversion","npmdownloads","daviddm","daviddmdev","---","slackin","patreon","gratipay","flattr","paypal","bitcoin","wishlist"],"config":{"patreonUsername":"bevry","gratipayUsername":"bevry","flattrCode":"344188/balupton-on-Flattr","paypalButtonID":"QB8GQPZAH84N6","bitcoinURL":"https://bevry.me/bitcoin","wishlistURL":"https://bevry.me/wishlist","slackinURL":"https://slack.bevry.me"}},"author":{"name":"2015+ Bevry Pty Ltd","email":"us@bevry.me","url":"http://bevry.me"},"maintainers":[{"name":"bevryme","email":""}],"contributors":[{"name":"Benjamin Lupton","email":"b@lupton.cc","url":"https://github.com/balupton"}],"bugs":{"url":"https://github.com/bevry/esnextguardian/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/bevry/esnextguardian.git"},"browsers":true,"engines":{"node":">=0.10"},"dependencies":{},"devDependencies":{"projectz":"^1.0.2"},"main":"./index.js","scripts":{"clean":"node --harmony nakefile.js clean","setup":"node --harmony nakefile.js setup","compile":"node --harmony nakefile.js compile","watch":"node --harmony nakefile.js watch","verify":"node --harmony nakefile.js verify","meta":"node --harmony nakefile.js meta","prepare":"node --harmony nakefile.js prepare","release":"node --harmony nakefile.js release","test":"echo 'no tests'"},"gitHead":"6bb88fdf820d642fe1b76cbc38b7afcb7c80211e","_id":"esnextguardian@1.0.1","_shasum":"890bd78cf5d22ceae67d5f14bd5342135cfae1a1","_from":".","_npmVersion":"3.3.2","_nodeVersion":"4.0.0","_npmUser":{"name":"balupton","email":"b@lupton.cc"},"dist":{"shasum":"890bd78cf5d22ceae67d5f14bd5342135cfae1a1","size":4919,"noattachment":false,"key":"/esnextguardian/-/esnextguardian-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/esnextguardian/download/esnextguardian-1.0.1.tgz"},"directories":{},"publish_time":1442550675118,"_cnpm_publish_time":1442550675118,"_hasShrinkwrap":false},"1.0.0":{"title":"ESNextGuardian","name":"esnextguardian","version":"1.0.0","description":"Load your ES6+ files if the user's environment supports it, otherwise gracefully fallback to your ES5 files.","homepage":"https://github.com/bevry/esnextguardian","license":"MIT","keywords":["es6","es6+","esnext","es2015","es2015+","es2016","es7","es5","babel"],"badges":{"list":["npmversion","npmdownloads","daviddm","daviddmdev","---","slackin","patreon","gratipay","flattr","paypal","bitcoin","wishlist"],"config":{"patreonUsername":"bevry","gratipayUsername":"bevry","flattrCode":"344188/balupton-on-Flattr","paypalButtonID":"QB8GQPZAH84N6","bitcoinURL":"https://bevry.me/bitcoin","wishlistURL":"https://bevry.me/wishlist","slackinURL":"https://slack.bevry.me"}},"author":{"name":"2015+ Bevry Pty Ltd","email":"us@bevry.me","url":"http://bevry.me"},"maintainers":[{"name":"bevryme","email":""}],"contributors":[{"name":"Benjamin Lupton","email":"b@lupton.cc","url":"https://github.com/balupton"}],"bugs":{"url":"https://github.com/bevry/esnextguardian/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/bevry/esnextguardian.git"},"browsers":true,"engines":{"node":">=0.10"},"dependencies":{},"devDependencies":{"projectz":"^1.0.2"},"main":"./index.js","scripts":{"clean":"node --harmony nakefile.js clean","setup":"node --harmony nakefile.js setup","compile":"node --harmony nakefile.js compile","watch":"node --harmony nakefile.js watch","verify":"node --harmony nakefile.js verify","meta":"node --harmony nakefile.js meta","prepare":"node --harmony nakefile.js prepare","release":"node --harmony nakefile.js release","test":"echo 'no tests'"},"gitHead":"a553eeb7fe056e38960229e7c051ae11f185501e","_id":"esnextguardian@1.0.0","_shasum":"cb801afe4c03208e3e5b49ba5ccab1a4c70e77a2","_from":".","_npmVersion":"3.3.2","_nodeVersion":"4.0.0","_npmUser":{"name":"balupton","email":"b@lupton.cc"},"dist":{"shasum":"cb801afe4c03208e3e5b49ba5ccab1a4c70e77a2","size":4907,"noattachment":false,"key":"/esnextguardian/-/esnextguardian-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/esnextguardian/download/esnextguardian-1.0.0.tgz"},"directories":{},"publish_time":1442550076341,"_cnpm_publish_time":1442550076341,"_hasShrinkwrap":false}},"readme":"<!-- TITLE/ -->\n\n<h1>ESNextGuardian</h1>\n\n<!-- /TITLE -->\n\n\n<!-- BADGES/ -->\n\n<span class=\"badge-travisci\"><a href=\"http://travis-ci.org/bevry/esnextguardian\" title=\"Check this project's build status on TravisCI\"><img src=\"https://img.shields.io/travis/bevry/esnextguardian/master.svg\" alt=\"Travis CI Build Status\" /></a></span>\n<span class=\"badge-npmversion\"><a href=\"https://npmjs.org/package/esnextguardian\" title=\"View this project on NPM\"><img src=\"https://img.shields.io/npm/v/esnextguardian.svg\" alt=\"NPM version\" /></a></span>\n<span class=\"badge-npmdownloads\"><a href=\"https://npmjs.org/package/esnextguardian\" title=\"View this project on NPM\"><img src=\"https://img.shields.io/npm/dm/esnextguardian.svg\" alt=\"NPM downloads\" /></a></span>\n<span class=\"badge-daviddm\"><a href=\"https://david-dm.org/bevry/esnextguardian\" title=\"View the status of this project's dependencies on DavidDM\"><img src=\"https://img.shields.io/david/bevry/esnextguardian.svg\" alt=\"Dependency Status\" /></a></span>\n<span class=\"badge-daviddmdev\"><a href=\"https://david-dm.org/bevry/esnextguardian#info=devDependencies\" title=\"View the status of this project's development dependencies on DavidDM\"><img src=\"https://img.shields.io/david/dev/bevry/esnextguardian.svg\" alt=\"Dev Dependency Status\" /></a></span>\n<br class=\"badge-separator\" />\n<span class=\"badge-slackin\"><a href=\"https://slack.bevry.me\" title=\"Join this project's slack community\"><img src=\"https://slack.bevry.me/badge.svg\" alt=\"Slack community badge\" /></a></span>\n<span class=\"badge-patreon\"><a href=\"http://patreon.com/bevry\" title=\"Donate to this project using Patreon\"><img src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /></a></span>\n<span class=\"badge-gratipay\"><a href=\"https://www.gratipay.com/bevry\" title=\"Donate weekly to this project using Gratipay\"><img src=\"https://img.shields.io/badge/gratipay-donate-yellow.svg\" alt=\"Gratipay donate button\" /></a></span>\n<span class=\"badge-flattr\"><a href=\"https://flattr.com/profile/balupton\" title=\"Donate to this project using Flattr\"><img src=\"https://img.shields.io/badge/flattr-donate-yellow.svg\" alt=\"Flattr donate button\" /></a></span>\n<span class=\"badge-paypal\"><a href=\"https://bevry.me/paypal\" title=\"Donate to this project using Paypal\"><img src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /></a></span>\n<span class=\"badge-bitcoin\"><a href=\"https://bevry.me/bitcoin\" title=\"Donate once-off to this project using Bitcoin\"><img src=\"https://img.shields.io/badge/bitcoin-donate-yellow.svg\" alt=\"Bitcoin donate button\" /></a></span>\n<span class=\"badge-wishlist\"><a href=\"https://bevry.me/wishlist\" title=\"Buy an item on our wishlist for us\"><img src=\"https://img.shields.io/badge/wishlist-donate-yellow.svg\" alt=\"Wishlist browse button\" /></a></span>\n\n<!-- /BADGES -->\n\n\n<!-- DESCRIPTION/ -->\n\nLoad your ES6+ files if the user's environment supports it, otherwise gracefully fallback to your ES5 files.\n\n<!-- /DESCRIPTION -->\n\n\n## Why?\n\nWhen ESNext (i.e. ES6+) files are used natively, you gain these benefits:\n\n1. It is much easier for debugging as your are debugging your source code, not compiled code\n\n2. Can be faster due to:\n\n \t1. Polyfills having to work around native features by going the long way, which can be very slow (e.g. `() => {}` vs `function () {}.bind(this)`\n\n\t2. JavaScript engines are better able to optimise your code due to the source code maintaining the original intention better than the compiled code (e.g. `const` vs `var`)\n\n\tA detailed performance comparison can be found at [bevry/es6-benchmarks](https://github.com/bevry/es6-benchmarks).\n\nHowever, unless you have absolute control over the environment in which your code runs, and are only making use of ECMAScript features that the target environment supports, then you simply can't always take advantage of these benefits.\n\nGenerally, this leaves the option of compiling your ESNext code down to ES5 code, and publishing only your ES5 code for consumption — which as indicated, is harder to debug and is often slower.\n\nThe other option is to publish your ESNext code and include a runtime polyfill, which increases the runtime footprint, and makes performance at runtime slower — and may break things if the polyfill functionality conflicts or changes from package to package or version to version.\n\nFortunately, unless you deliberately use unstable ESNext features, then you are merely using features that are already standardized and are already making their way into modern environments, to run exactly as intended. This means your can publish your code in ESNext today with expectations of it working in the environments of the future.\n\nWe can utilise this feature of ESNext to our advantage, by publishing both the ESNext code, as well as our compiled fallback ES5 code, we can publish code that will have many benefits in environments that supports it, and fallback to harder to debug slower code on environments that don't support the best. The best of both worlds. This is what ESNextGuardian makes easy for you.\n\n\n## Usage\n\n1. If you haven't already got setup with ES6+, you can do so by:\n\n\t1. Install [Babel](https://babeljs.io) as a development dependency:\n\n\t\t``` shell\n\t\tnpm install --save-dev babel-cli\n\t\t```\n\n    1. [Configure](http://babeljs.io/docs/plugins/preset-es2015/) Babel to compile ESNext to ES5:\n\n        ``` shell\n        npm install --save-dev babel-preset-es2015\n        wget -N https://raw.githubusercontent.com/bevry/base/master/.babelrc\n        ```\n\n\t1. Use this command to compile your ESNext files (inside an `esnext` directory) to ES5 files (inside a `es5` directory):\n\n\t\t``` shell\n\t\t./node_modules/.bin/babel esnext --out-dir es5\n\t\t```\n\n\t\tOptional: If you would like that command to run with `npm run-script compile` instead (which is a bit more streamlined), you can do so by adding it to your `package.json` file under `scripts` then `compile` like so:\n\n\t\t``` json\n\t\t{\n\t\t\t\"scripts\": {\n\t\t\t\t\"compile\": \"./node_modules/.bin/babel esnext --out-dir es5\"\n\t\t\t}\n\t\t}\n\t\t```\n\n1. Install and add ESNextGuardian to your project's dependencies:\n\n\t``` shell\n\tnpm install --save esnextguardian\n\t```\n\n1. Create an `esnextguardian.js` file in the root of your project, containing the following, customising the paths to your desired ESNext and ES5 main files.\n\n \t``` javascript\n    // 2015 December 8\n    // https://github.com/bevry/esnextguardian\n    'use strict'\n    module.exports = require('esnextguardian')(\n    \trequire('path').join(__dirname, 'esnext', 'lib', 'index.js'),\n    \trequire('path').join(__dirname, 'es5', 'lib', 'index.js'),\n        require\n    )\n\t```\n\n\tWe pass `require` as the 3rd argument to ensure that the require setup/configuration/environment remains the same as the module calling ESNextGuardian, it can differ between modules.\n\n    We use `require('path').join` with `__dirname` to ensure that debugging messages and stack traces are indicative of the module calling ESNextGuardian, as the relative paths alone do not provide enough to be useful for those use cases.\n\n1. Make the following changes to your `package.json` file:\n\n\t``` json\n\t{\n\t\t\"main\": \"./esnextguardian.js\",\n\t\t\"browser\": \"./es5/lib/index.js\",\n\t\t\"jspm\": {\n\t\t\t\"main\": \"./es5/lib/index.js\"\n\t\t}\n\t}\n\t```\n\n\tThis will use:\n\n\t- The ESNextGuardian script by default for cross-enviroment compatibility\n    - The ES5 Script for:\n        - [browserify](http://browserify.org/) (a CommonJS compiler that uses the [`browser` field](https://github.com/substack/node-browserify#browser-field))\n        - [jspm](http://jspm.io) (an ES6 package manager that uses the [`jspm.main` field](https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm#prefixing-configuration))\n            - jspm uses the ES5 Script as ESNext support in jspm has not been released yet, [details here](https://github.com/bevry/domain-browser/pull/7#issuecomment-160814333)\n\n1. All done, you may now test and publish your package.\n\nNotes:\n\n- Node.js [does not support](https://twitter.com/balupton/status/671519915795345410) [ECMAScript Modules](https://babeljs.io/docs/learn-es2015/#modules) so if you want ESNextGuardian to be of any value, be sure to use [Node.js (CommonJS) Modules](https://nodejs.org/api/modules.html) exclusively in your modules.\n\n    If you use [ESLint](http://eslint.org) you can set `ecmaFeatures.modules` to `false` in your [ESLint configuration](http://eslint.org/docs/user-guide/configuring) to help enforce this.\n\n- If you don't want your git repository polluted with your ES5 compiled files, add your ES5 files to your `.gitignore` file, like so:\n\n\t```\n\t# Build Files\n\tes5/\n\t```\n\n- The following environment boolean flags are available:\n\n    - `DEBUG_ESNEXTGUARDIAN` when `true` will output relevant debug information regarding (it is recommended you enable this for your development environments):\n\n        - If the ESNext script fails to load, the error message as to why will be outputted\n        - If relative paths were provided to ESNextGuardian a non-fatal warning will be outputted\n        - If the `require` argument was not provided to ESNextGuardian, a non-fatal warning will be outputted\n\n    - `REQUIRE_ESNEXT` when `true` will only attempt to load the ESNext script\n\n    - `REQUIRE_ES5` when `true` will only attempt to load the ES5 script\n\n\n<!-- HISTORY/ -->\n\n<h2>History</h2>\n\n<a href=\"https://github.com/bevry/esnextguardian/blob/master/HISTORY.md#files\">Discover the release history by heading on over to the <code>HISTORY.md</code> file.</a>\n\n<!-- /HISTORY -->\n\n\n<!-- CONTRIBUTE/ -->\n\n<h2>Contribute</h2>\n\n<a href=\"https://github.com/bevry/esnextguardian/blob/master/CONTRIBUTING.md#files\">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>\n\n<!-- /CONTRIBUTE -->\n\n\n<!-- BACKERS/ -->\n\n<h2>Backers</h2>\n\n<h3>Maintainers</h3>\n\nThese amazing people are maintaining this project:\n\n<ul><li><a href=\"http://balupton.com\">Benjamin Lupton</a> — <a href=\"https://github.com/bevry/esnextguardian/commits?author=balupton\" title=\"View the GitHub contributions of Benjamin Lupton on repository bevry/esnextguardian\">view contributions</a></li></ul>\n\n<h3>Sponsors</h3>\n\nNo sponsors yet! Will you be the first?\n\n<span class=\"badge-patreon\"><a href=\"http://patreon.com/bevry\" title=\"Donate to this project using Patreon\"><img src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /></a></span>\n<span class=\"badge-gratipay\"><a href=\"https://www.gratipay.com/bevry\" title=\"Donate weekly to this project using Gratipay\"><img src=\"https://img.shields.io/badge/gratipay-donate-yellow.svg\" alt=\"Gratipay donate button\" /></a></span>\n<span class=\"badge-flattr\"><a href=\"https://flattr.com/profile/balupton\" title=\"Donate to this project using Flattr\"><img src=\"https://img.shields.io/badge/flattr-donate-yellow.svg\" alt=\"Flattr donate button\" /></a></span>\n<span class=\"badge-paypal\"><a href=\"https://bevry.me/paypal\" title=\"Donate to this project using Paypal\"><img src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /></a></span>\n<span class=\"badge-bitcoin\"><a href=\"https://bevry.me/bitcoin\" title=\"Donate once-off to this project using Bitcoin\"><img src=\"https://img.shields.io/badge/bitcoin-donate-yellow.svg\" alt=\"Bitcoin donate button\" /></a></span>\n<span class=\"badge-wishlist\"><a href=\"https://bevry.me/wishlist\" title=\"Buy an item on our wishlist for us\"><img src=\"https://img.shields.io/badge/wishlist-donate-yellow.svg\" alt=\"Wishlist browse button\" /></a></span>\n\n<h3>Contributors</h3>\n\nThese amazing people have contributed code to this project:\n\n<ul><li><a href=\"http://balupton.com\">Benjamin Lupton</a> — <a href=\"https://github.com/bevry/esnextguardian/commits?author=balupton\" title=\"View the GitHub contributions of Benjamin Lupton on repository bevry/esnextguardian\">view contributions</a></li></ul>\n\n<a href=\"https://github.com/bevry/esnextguardian/blob/master/CONTRIBUTING.md#files\">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>\n\n<!-- /BACKERS -->\n\n\n<!-- LICENSE/ -->\n\n<h2>License</h2>\n\nUnless stated otherwise all works are:\n\n<ul><li>Copyright &copy; 2015+ <a href=\"http://bevry.me\">Bevry Pty Ltd</a></li></ul>\n\nand licensed under:\n\n<ul><li><a href=\"http://spdx.org/licenses/MIT.html\">MIT License</a></li></ul>\n\n<!-- /LICENSE -->\n","_attachments":{},"homepage":"https://github.com/bevry/esnextguardian","bugs":{"url":"https://github.com/bevry/esnextguardian/issues"},"license":"MIT"}