{"name":"realms-shim","version":"1.1.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: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","nyc":"^14.1.1","prettier":"^1.18.2","rollup":"^1.21.4","rollup-plugin-babel-minify":"^9.1.0","rollup-plugin-strip-code":"^0.2.7","sinon":"^7.5.0","tape":"^4.11.0"},"gitHead":"357beba0387c0ac2c4ae20ec524e9dbb56ca0000","_id":"realms-shim@1.1.2","_nodeVersion":"12.7.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-FadHiwVXkVGyGGGtdn6vWsmVMFEBci/vVocIfx2Gb9v6Ha8tux2H4z8vZH85YIpAL9azGuDPlSAyvRxWbydmUQ==","shasum":"3a6f438e38a31e9189fbb22f83226e0ab064d237","tarball":"http://registry-npm.ywwl.com/realms-shim/download/realms-shim-1.1.2.tgz","fileCount":18,"unpackedSize":584325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjBYNCRA9TVsSAnZWagAAlYcQAJZoku4MGUkuRC7eQGe6\nqVjurZs7tIXhSBGqYdBPB8dt9aztb3Gg+wJ6ISntk1801HxtRI/y5hjlXwfx\nz/H+S0T55x0QQajd29QbFbCq+u1xsFVLfmbpQXwAdMzBCwM0FwtqtLpB4p1O\ncRPaJfQ0d5XlHeunjkNxJzoDCB80hu0lP086cD9P9vplqKf7EQJywIsCQ7k7\nebKZNxxuaz0apf21vaN9enmJA3vneKIhhCEjR2l3PNvkl2mB4jZsNDRWHJvi\nZBtruS+cpFO/pRqYVKiF4ibCKpZ0QaGbD2wVGCq93rmaBc3QsVMBo3J5xh6G\nHCknHSW6/oovXWJfGa3qF/mkdffYCOAsn/1bCrpXzJ68wR6xGrQfR40jID6E\nrgqYpeDG+ghcVUnwRTxLreCL96WrkE7oju1FBlDYD3CacSxjnJjQK0F8+bUe\nAcNh8MmjmZwAeW4lHAdNzGBXb3+gUhu7Rw7mlZ06skvRrAVjCF6UD5SzkdUa\nL2+JDgMWaVrvbpwgRdpots4OdNv7CGfhATyk6LXjkYf4JjfwQAIi7XCDOo8P\nmhEkZe4faLTuMgp9Ui7KDUvqDwa7qFhlNe67luyhDid+/pRTZF/87ootHo/y\nH7K/draxUCdvC9vgDJyM3mSckkC1VttxaxsqWMJglhieriTwB1fLvDEF5QbG\n+C79\r\n=D2u6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7sBbjHW6C6LaqxyWutW1L7zoou4Psc1Nsm2jaooc4OQIgDNyXbsthCp+CgWN4OuXP1G6EUOVcCnRVjsAKn7S9I7w="}],"size":173416,"noattachment":false,"key":"/realms-shim/-/realms-shim-1.1.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.1.2_1569461773153_0.8129534763054149"},"_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":1569461773314,"_cnpm_publish_time":1569461773314,"dist-tags":{"latest":"1.2.2"}}