{"name":"realms-shim","version":"1.2.2","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":"bb0cc3ca69c07e5511565966229545ea67d461a8","_id":"realms-shim@1.2.2","_nodeVersion":"13.4.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-NOskQ7IJEnHN4Dhu462Pf0Kl8YHSPjt6V+fVvrGSCs/SfAa433CLTyJ632DFsZC2ENBQ9p6tEZ3w+1Vkycuwyg==","shasum":"bdf828ee316afa4c9ea2aab364d55b8ad7eb5904","tarball":"http://registry-npm.ywwl.com/realms-shim/download/realms-shim-1.2.2.tgz","fileCount":18,"unpackedSize":642079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRIVsCRA9TVsSAnZWagAAhmcP/3533m1EVsOZW1x+gQvs\nn8UwfVbexv7ZioRkY6Y0uL6yarpfFYf+i1gQ4vOhQQkOf8BhmXug0Or6UXYK\nt/IcVnFTYxITUHGjw2EVzWxIiALooZqLUIHUtLCelcEA/Io8AVMSEWvvc6jV\nJzErqWONuhWYThOdHJSCajR6x685MfMytvT8NwHy7SPxkPbJyE/QoLRsN79D\ntekvWlNZ1vzghDhiKo/U2+eDuabme5praPJctR2LP5dGwFwQcJFyRmucJhIl\n6r2ftV0zCcSeNsZVSsSte/GRKZn+lWjPl6cTk4Ums2ZJCz38CqHr/KW5cJ3k\n6DWP12yqS0i8oJR83KH/7OHT4AhQFJ7EBImPpDTDYTH8UWsf2qfalL33UR1H\nEZYoFXlNtAXzkGXSBbNJjvivvY2poadvhUFKob/Bi2K+mjD4je1NYZ7nutRi\nq3EKpNM8BKvVhCv+T2ZSmuvzUtpBGU7kRNtoyhUg2uyt98BIkMhs+YLh+MPU\nrs7Li1smXbuw94X0pp0GOMTxnMtkXZS+EsV8OkMtR0hva8QiRo7++PQ9lW5i\nGFbE5AvnXYI2ANdL0v3xPSKYTxkm+S8sv7s68/3KT6l8KtruVIVZiMrkz+Wi\nbhyUILeiVIseG62+hiKQjv2gEo30Z5Mmdx6kUzsLynY0wgFvPySe/Hfc+3Q6\n7dhx\r\n=vXdp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQzGPPKvAuwWvBIc3SuvLq76ijm1fKqCrV+53DMPJu5QIgbh2y4/UKaIGzMUKydUBAhPAgaLUrAROfmX/aW9Bael8="}],"size":185999,"noattachment":false,"key":"/realms-shim/-/realms-shim-1.2.2.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.2_1581548908505_0.27817003001643603"},"_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":1581548908701,"_cnpm_publish_time":1581548908701,"dist-tags":{"latest":"1.2.2"}}