{"name":"realms-shim","version":"1.2.0","description":"Spec-compliant shim for Realms TC39 Proposal","main":"dist/realms-shim.cjs.js","module":"dist/realms-shim.esm.js","browser":"dist/realms-shim.umd.js","license":"Apache-2.0","author":{"name":"TC39 Open Source Contributors"},"keywords":["realms","ES8","ES2017","ECMAScript","ESNext","proposal"],"homepage":"https://github.com/Agoric/realms-shim#readme","bugs":{"url":"https://github.com/Agoric/realms-shim/issues"},"repository":{"type":"git","url":"git+https://github.com/Agoric/realms-shim.git"},"scripts":{"test":"npm run shim:test","build":"npm run shim:build","shim:lint":"eslint ./src ./test ./examples","shim:prettier":"prettier --config ./.prettierrc --write ./src/**/**/*.js ./test/**/**/*.js ./examples/**/**/*.js","shim:test":"tape -r esm './test/**/*.js'","shim:test-integration":"tape -r esm './test-integration/**/*.js'","shim:coverage":"nyc tape -r esm ./test/**/**/*.js","shim:coveralls":"nyc report --reporter=text-lcov | coveralls","shim:build":"npm run shim:build:dev && npm run shim:build:prod","shim:watch":"npm run shim:build:dev --watch","shim:build:dev":"rollup -c","shim:build:prod":"rollup -c --environment NODE_ENV:production"},"devDependencies":{"coveralls":"^3.0.6","eslint":"^6.4.0","eslint-config-airbnb-base":"^14.0.0","eslint-config-prettier":"^6.3.0","eslint-plugin-import":"^2.18.2","eslint-plugin-prettier":"^3.1.1","esm":"^3.2.25","mixed-tape":"^1.0.2","nyc":"^14.1.1","prettier":"^1.18.2","rollup":"^1.21.4","rollup-plugin-babel-minify":"^9.1.0","sinon":"^7.5.0","tape":"^4.11.0"},"gitHead":"ec253317c6e78a039f823f573376c4c09552330a","_id":"realms-shim@1.2.0","_nodeVersion":"12.7.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-eVet6pLh6+Fk7eHCrGh1gnli7LByI2snWI+vcpF+3neVs0dRnmDW+msA+sVr+EOpVPnrAqXcwoIDP/pr9Wn6cw==","shasum":"455b5ecac711f8907cdd1e7a2bc6cb173f3a3f09","tarball":"http://registry-npm.ywwl.com/realms-shim/download/realms-shim-1.2.0.tgz","fileCount":18,"unpackedSize":641480,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlPYICRA9TVsSAnZWagAAyrAP/02lCzOb99gnKlajoRdD\n9jnfObnkSZoN7SRrtVgMzg38D8SEDF2a9PXAS8pUEQwTkLJHukq5y7B7eirz\nlAx1PR+Utvgkdo/nQNOyOHFBDOY0sAQ0EF2SYZYPsZToNQDFBB9F6cqKHAQr\n8H0OF8Rx8ETaAVhw0kCQNXxMBzV9SiBTElaREg3ZIgPgXl/GEAs3xw4RaT13\nfy6BMFLVXnhqJGWgDl7JUWb8JfqZAFSpgu9SgWCfW9IwgXjI4NQ+ThK1UqzD\nJWg5V3BVk609GsYwDItlj+QxvvehRokxB5EzNWro/ZITQjXssBFH85BK1ZWb\nhmxb3qogaGZvcT7h5hxQRF6CCPNzPr0Px1crq0JVCOB8E6ui++Gjsa/Cr2l7\nDICeeqMGVvtOH1SE1V81G+Lt4SGQTyXHlqFQhihhTj5c25gwYZlLlWT/Y+eR\nz72qx8NJzvw/joFlXgJfCsuAm5Ea/Og8TZOq5Illl+85yRDT9JJu1Fgy0Pp6\nwk0jnh5VJbkhViSB06dZjIzRZ064cIe6fRNEcLrSWvgp6mwIIgbPvpbfCB2Y\nlsUz0uiegox5mWG9x+9vY2APWsW1TPzs6wr9A4ZEQWi3+lAvpAOz5/VujmZf\nzpPQOM8+HntI25Da9yH6J5wV97chubw4GMs0mGWv2lFHqwG9QpXFHODAGFiv\nkcS7\r\n=OUyk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZp9qMgApofPTTIJjfSq0vc1WTaVwUbWnm2fLIp/AxnAiBu5VuCzl3nx0tNYc9ug3itWzEHcHuIQbK9yj+/4RJu/w=="}],"size":186430,"noattachment":false,"key":"/realms-shim/-/realms-shim-1.2.0.tgz"},"maintainers":[{"email":"erights@gmail.com","name":"erights"},{"email":"kate@agoric.com","name":"katesills"},{"email":"michael@fig.org","name":"michaelfig"},{"email":"warner-npm@lothar.com","name":"warner"}],"_npmUser":{"name":"warner","email":"warner-npm@lothar.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/realms-shim_1.2.0_1570043399905_0.018199315330110766"},"_hasShrinkwrap":false,"deprecated":"TC39 has taken Realms in a new direction (ShadowRealm) and the security properties of the realms-shim have not been maintained.","readme":"# Realm Shim\n[![Build Status][circleci-svg]][circleci-url]\n[![Coverage Status][coveralls-svg]][coveralls-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n\n\nThis folder contains a shim implementation of the [Realm API Proposal](https://github.com/tc39/proposal-realms/#ecmascript-spec-proposal-for-realms-api). \n\n## Limitations\n\nThe current implementation has 3 main limitations:\n\n* All code evaluated inside a Realm runs in strict mode.\n* Direct eval is not supported.\n* `let`, global function declarations and any other feature that relies on new bindings in global contour are not preserved between difference invocations of eval, instead we create a new contour everytime.\n\n## Building the Shim\n\n```bash\ngit clone https://github.com/Agoric/realms-shim.git\ncd realms-shim\nnpm install\nnpm run shim:build\n```\n\nThis will install the necessary dependencies and build the shim locally.\n\n## Playground\n\nTo open the playground example in your default browser:\n\n```bash\nnpm run shim:build\nopen examples/simple.html\n```\n\n## Usage\n\nTo use the shim in a webpage, build the shim, then:\n\n```html\n  <script src=\"../dist/realm-shim.min.js\"></script>\n  <script>\n    const r = new Realm();\n    [...]\n  </script>\n```\n\nTo use the shim with node:\n```js\n  const Realm = require('./realm-shim.min.js');\n  const r = new Realm();\n  [...]\n```\n\nYou can also use the ES6 module version of the Realms shim in Node.js via the package `esm`. To do that, launch node with esm via the \"require\" option:\n\n```bash\nnpm install esm\nnode -r esm main.js\n```\n\nAnd import the realm module in your code:\n\n```js\n  import Realm from './src/realm';\n  const r = new Realm();\n  [...]\n```\n\n## Examples\n\n### Example 1: Root Realm\n\nTo create a root realm with a new global and a fresh set of intrinsics:\n\n```js\nconst r = new Realm(); // root realm\nr.global === this; // false\nr.global.JSON === JSON; // false\n```\n\n### Example 2: Realm Compartment\n\nTo create a realm compartment with a new global and inherit the intrinsics from another realm:\n\n```js\nconst r1 = new Realm(); // root realm\nconst r2 = new r1.global.Realm({ intrinsics: 'inherit' }); // realm compartment\nr1.global === r2.global; // false\nr1.global.JSON === r2.global.JSON; // true\n```\n\n### Example 3: Realm Compartment from current Realm\n\nTo create a realm compartment with a new global and inherit the intrinsics from the current execution context:\n\n```js\nconst r = new Realm({ intrinsics: 'inherit' }); // realm compartment\nr.global === this; // false\nr.global.JSON === JSON; // true\n```\n\n\n## Bug Disclosure\n\nPlease help us practice coordinated security bug disclosure, by using the\ninstructions in\n[SECURITY.md](https://github.com/Agoric/realms-shim/blob/master/SECURITY.md)\nto report security-sensitive bugs privately.\n\nFor non-security bugs, please use the [regular Issues\npage](https://github.com/Agoric/realms-shim/issues).\n\n\n[circleci-svg]: https://circleci.com/gh/Agoric/realms-shim.svg?style=svg\n[circleci-url]: https://circleci.com/gh/Agoric/realms-shim\n[coveralls-svg]: https://coveralls.io/repos/github/Agoric/realms-shim/badge.svg\n[coveralls-url]: https://coveralls.io/github/Agoric/realms-shim\n[deps-svg]: https://david-dm.org/Agoric/realms-shim.svg\n[deps-url]: https://david-dm.org/Agoric/realms-shim\n[dev-deps-svg]: https://david-dm.org/Agoric/realms-shim/dev-status.svg\n[dev-deps-url]: https://david-dm.org/Agoric/realms-shim?type=dev\n[license-image]: https://img.shields.io/badge/License-Apache%202.0-blue.svg\n[license-url]: LICENSE\n","publish_time":1570043400137,"_cnpm_publish_time":1570043400137,"dist-tags":{"latest":"1.2.2"}}