{"name":"realms-shim","version":"1.1.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: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":"cross-env NODE_ENV=development rollup -c rollup.config.js","shim:build:prod":"cross-env NODE_ENV=production rollup -c rollup.config.js"},"devDependencies":{"coveralls":"^3.0.3","cross-env":"^5.2.0","eslint":"^5.15.3","eslint-config-airbnb-base":"^13.1.0","eslint-config-prettier":"^4.1.0","eslint-plugin-import":"^2.16.0","eslint-plugin-prettier":"^3.0.1","esm":"^3.2.18","nyc":"^14.0.0","prettier":"^1.16.4","rollup":"^1.6.0","rollup-plugin-babel-minify":"^8.0.0","rollup-plugin-strip-code":"^0.2.6","sinon":"^7.2.7","tape":"^4.10.1"},"_id":"realms-shim@1.1.0","_nodeVersion":"12.4.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-7fXmHSYnUM+Wix0yM0TwoMa4WWHSaRXyYaKqfoYl8BNokUoKaKD9tiKdBHkMlF7grd3G5A/XYuv3+XPvWW6adA==","shasum":"88584404ec82106960d33396582b6fe50b6fc16c","tarball":"http://registry-npm.ywwl.com/realms-shim/download/realms-shim-1.1.0.tgz","fileCount":16,"unpackedSize":419261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdguovCRA9TVsSAnZWagAAEakQAI6C9TfC2r72AVAS5XbY\n8jwjT3BrD/WmztRLJowMoc+KVlA6xROrn0xdNjnBHBD8DJBBMHKMHBW+QDSp\nFUbjGuzhpvRyLjNaGGZFCr4ySLOG7+Ad7Mj60uIP0rfkNJIFccp/r9pjaRy7\nEdVJ4/l3y3BzHIQXBW1Dmcci7FG9akKfeIyov6ZXZ2WBProiaVkZfroXNAel\nmnDggF6RePqnzQLJT9ZDRjQJ4U60yI4AaEe8shskKlj58moNrmI4tKtXb3P1\nZNyALcvAVtbw57E7dWCFlnvk2Rrq6clc9C393YJtow8KFI8sV4kpJIxcpgSb\nXril89E/bfFOnHmXOwznR88fhG8PWM2jM4cTffNppgIkFoH+YBPZi/sxwxRS\nNMp3gd7WqWtVP4hAf7uHfF1maJ9KB2RPKnsah0Jjfisi0ToybWL9wfZIuCJA\n+aMu6n113xT8oAs9PxnbBhGBVcUyxAc4H4z7nyuRSKAlce8MxDpLtjlMGMQS\nlD4geuzB1WzuMtQpFWOiMfiEhaeNsWsmu5ymRNaD0l0RuE2IqXA9eHExR+23\neiyRWS4cIoew7yjzttFAAtxyI3myRkaywL4hNFoGW9P0eF95ZIsqEBrIj8JH\nDIjnPjMHffdEoc1sg6N/twyKVpOrHBIodkfnvC83k/N+XFhPDJTnh7KrCdQU\nMsI3\r\n=XsN/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEjc2Bbgua/3OIxiVybxYRKeGBEctHVteVRPZHnjk8Y9AiEAvvT2UGSxT7qCX5dfaI+GYSsVnVACuZcbpmx79TeqoCM="}],"size":124580,"noattachment":false,"key":"/realms-shim/-/realms-shim-1.1.0.tgz"},"maintainers":[{"name":"michaelfig","email":"michael@fig.org"}],"_npmUser":{"name":"michaelfig","email":"michael@fig.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/realms-shim_1.1.0_1568860719142_0.15462135802207055"},"_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":1568860719266,"_cnpm_publish_time":1568860719266,"dist-tags":{"latest":"1.2.2"}}