{"_id":"worker-dom","_rev":"1-5228f8bb1ba577be297e1017bae81050","name":"worker-dom","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"worker-dom","version":"0.1.0","description":"A facsimile of a modern DOM implementation intended to run in a Web Worker.","main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/ampproject/worker-dom.git"},"engines":{"node":">=8.10.0"},"author":{"name":"The AMP HTML Authors"},"license":"Apache-2.0","scripts":{"pretest":"rimraf output && tsc -p config/tsconfig.test.worker-thread.json & tsc -p config/tsconfig.test.json & tsc -p config/tsconfig.test.main-thread.json & wait","test":"ava -v output/test/**/*.js","pre~rollup":"rimraf output dist && tsc -p config/tsconfig.build.worker-thread.json & tsc -p config/tsconfig.build.main-thread.json","~rollup":"rollup --config config/rollup.config.js","lint":"tslint -c config/tslint.json -p src/worker-thread/ & tslint -c config/tslint.json -p src/main-thread/","predebug":"DEBUG_BUNDLE=true npm run ~rollup","debug":"node -r esm demo/server.mjs","build":"MINIFY_BUNDLE=true npm run ~rollup","size":"npm run build && bundlesize"},"dependencies":{"dompurify":"1.0.7"},"devDependencies":{"@ampproject/rollup-plugin-closure-compiler":"0.6.1","@babel/cli":"v7.0.0-rc.1","@babel/core":"v7.0.0-rc.1","@babel/plugin-proposal-class-properties":"v7.0.0-rc.1","@babel/plugin-proposal-object-rest-spread":"v7.0.0-rc.1","@babel/preset-env":"v7.0.0-rc.1","acorn":"5.7.1","ava":"0.25.0","babel-plugin-minify-replace":"0.4.3","babel-plugin-transform-remove-console":"6.9.4","bundlesize":"0.17.0","esm":"3.0.76","husky":"1.0.0-rc.13","lint-staged":"7.2.2","magic-string":"0.25.0","polka":"0.4.0","prettier":"1.14.2","rimraf":"2.6.2","rollup":"0.64.1","rollup-plugin-babel":"4.0.0-beta.7","rollup-plugin-node-resolve":"3.3.0","serve-static":"1.13.2","tslint":"5.11.0","typescript":"3.0.1"},"lint-staged":{"*.ts":["prettier --config config/.prettierrc --write","git add"]},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"npm run test && npm run size"}},"bundlesize":[{"path":"./dist/worker.mjs","compression":"brotli","maxSize":"6 kB"},{"path":"./dist/worker.safe.mjs","compression":"brotli","maxSize":"7 kB"},{"path":"./dist/index.mjs","compression":"brotli","maxSize":"2 kB"},{"path":"./dist/index.safe.mjs","compression":"brotli","maxSize":"7 kB"}],"files":["index.mjs","index.safe.mjs","index.js","index.safe.js","worker.mjs","worker.safe.mjs","worker.js","worker.safe.js"],"gitHead":"16ff0d48d552ea35a1228291db2897d637e1baa9","bugs":{"url":"https://github.com/ampproject/worker-dom/issues"},"homepage":"https://github.com/ampproject/worker-dom#readme","_id":"worker-dom@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"kristoferbaxter","email":"kbax@me.com"},"dist":{"integrity":"sha512-+UVJk9mc6CetcFWvdW8TXUT7f5o4awNvGZaopjFDGifVCBKCt+WL/bWl76chliJGYrxZkGB8b5fDaDHlCBi2nw==","shasum":"024f84804c97e5de75bc40c30ce0730798aeaecf","tarball":"https://registry.npmjs.org/worker-dom/-/worker-dom-0.1.0.tgz","fileCount":11,"unpackedSize":733686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfII0CRA9TVsSAnZWagAADS4P/Ra8BNv3UzQ7IxVPgrYm\nrXcZR7vknJLfHFxqFh/ODsrCEX0YmOywWzccAGa8G3IFinodrU5nBJfvlgeS\nv6pLSCLdp/yDns2wheRzxiACPfJ6vpfxuURUQ8yD/z4Dn3Df24lGWAYkMXxG\nj92XfaZIH2UUqobQ1HbueSx5H/TMMUmaeqbz++lyFyfW10bLkEiR5Qumx2VK\ncvgngyxfI2JpQp7Fq5ihGd5n2u+uzwbuYUrT3FzVzxzmn5WOyc/z3N3h2IwD\nMarncrjo7XPR3Ix5FeQ2obrWBeSqFhMSYZ3MPHjKBmP06N+Pdrf9uQHyWjvk\n1Gbz0WejhREiDDoNOEVvP4FkA0x2aDUuipRqfpyXTtpXpnIjclx79yj4Na42\nAOxT5jyL3BkWjXbfqjBZnpVtTkTdE95Zn7i+vKOXVBuh7AM0AlnXQ4oZyqYn\nsIEpIrvRmdRB1aGl/2a5TR3FdacBfsYblfH7ZqNdJ0eFmBJLchT8VC12P7iG\nww8acFUusOFeP9escMIt0Es+GLzDIpR5siWhslIesvSN/9v6nFVV7hKx6Nyi\nIoFNGmhCFxgjGdhVBkgWk9KC7Pwv/Sj/jwuB1R059ojgK/ZQT5c934dKw3a4\narnnpw8y2yZqFXWlr0wN9w40EEae19y/b93I3RCtcB7P2VUmwZ/5j6oizCK8\nqNc1\r\n=4GmW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDK6+a/0i1TpOY/NM+zU7uB+S0gWQxhv3tQYRwdK4hBLQIhAMZ4Iyx6vIenMnHHa+5uKC19OQt7Ez61ifiCRSCyhy8Y"}]},"maintainers":[{"name":"kristoferbaxter","email":"kbax@me.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/worker-dom_0.1.0_1534886451926_0.08048324652772165"},"_hasShrinkwrap":false}},"time":{"created":"2018-08-21T21:20:51.925Z","0.1.0":"2018-08-21T21:20:52.553Z","modified":"2022-05-24T16:41:48.947Z"},"maintainers":[{"name":"kristoferbaxter","email":"kbax@me.com"}],"description":"A facsimile of a modern DOM implementation intended to run in a Web Worker.","homepage":"https://github.com/ampproject/worker-dom#readme","repository":{"type":"git","url":"git+https://github.com/ampproject/worker-dom.git"},"author":{"name":"The AMP HTML Authors"},"bugs":{"url":"https://github.com/ampproject/worker-dom/issues"},"license":"Apache-2.0","readme":"# WorkerDOM\n\nAn in-progress implementation of the DOM API intended to run within a Web Worker. \n\n**Purpose**: Move complexity of intermediate work related to DOM mutations to a background thread, sending only the necessary manipulations to a foreground thread.\n\n**Use Cases**:\n1. Embedded content from a third party living side by side with first party code.\n2. Mitigation of expensive rendering for content not requiring syncronous updates to user actions.\n3. Retaining main thread availablity for high priority updates by async updating elsewhere in a document.  \n\n## Installation\n\n```bash\nnpm install @ampproject/worker-dom\n```\n\n## Usage\n\nInclude the WorkerDOM main thread code within your document directly or via a bundler.\n\n```html\n<script src=\"./dist/index.mjs\" type=\"module\"></script>\n<script src=\"./dist/index.js\" nomodule defer></script>\n```\n\nUpgrade a specific section of the document to be driven by a worker.\n\n**Note**: The nomodule format exposes the global `MainThread` whereas the module format allows one to directly import the `upgradeElement` method.\n```html\n<div src=\"hello-world.js\" id=\"upgrade-me\"></div>\n<script type=\"module\">\n  import {upgradeElement} from './dist/index.mjs';\n  upgradeElement(document.getElementById('upgrade-me'), './dist/worker.mjs');\n</script>\n<script nomodule async=false defer>\n  document.addEventListener('DOMContentLoaded', function() {\n    MainThread.upgradeElement(document.getElementById('upgrade-me'), './dist/worker.js');\n  }, false);\n</script>\n``` \n\n## Running Debug Demos\n\nAfter installing the library locally, you can try out the debug demos with the following.\n\n```bash\nnpm run debug\n```\n\n### \"Safe\" mode\n\nWorkerDOM has a special output variant that includes safety features e.g. HTML sanitization and a web worker sandbox. This variant is distributed under the \".safe\" suffix for main and worker thread binaries:\n\n```\nindex.safe.mjs\nindex.safe.js\n\nworker.safe.mjs\nworker.safe.js\n```\n\n## Security disclosures\n\nThe AMP Project accepts responsible security disclosures through the [Google Application Security program](https://www.google.com/about/appsecurity/).\n\n## Code of conduct\n\nThe AMP Project strives for a positive and growing project community that provides a safe environment for everyone.  All members, committers and volunteers in the community are required to act according to the [code of conduct](CODE_OF_CONDUCT.md).\n\n## License\n\nworker-dom is licensed under the [Apache License, Version 2.0](LICENSE).\n","readmeFilename":"README.md"}