{"_id":"one-webcrypto","_rev":"14-4cef478dde9063aca909ff529df89d0a","name":"one-webcrypto","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"one-webcrypto","version":"1.0.0","description":"Import the webcrypto API as a single module in both nodejs and browsers.","repository":{"type":"git","url":"git+https://github.com/fission-suite/one-webcrypto.git"},"author":{"name":"Philipp Krüger","email":"philipp@fission.codes"},"license":"MIT","types":"index.d.ts","main":"browser.cjs","exports":{".":{"browser":"./browser.cjs","import":"./node.mjs","require":"./node.cjs"},"./package.json":"./package.json"},"dependencies":{},"gitHead":"3ad712ea0b50b4b9d503219d16f160993a396bf0","bugs":{"url":"https://github.com/fission-suite/one-webcrypto/issues"},"homepage":"https://github.com/fission-suite/one-webcrypto#readme","_id":"one-webcrypto@1.0.0","_nodeVersion":"16.9.0","_npmVersion":"7.22.0","dist":{"integrity":"sha512-3JjdroVLZstd2dBQeN9Q2RfyrZdLfCPYdfMwKboSoHXvvTlON746rmak6OaLthUsuSngnl8AZ8A7f0SnR6Bn9Q==","shasum":"4ad436a6f76213a9c0c4484f873ab677074e0e14","tarball":"https://registry.npmjs.org/one-webcrypto/-/one-webcrypto-1.0.0.tgz","fileCount":6,"unpackedSize":3006,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQnCqms59wm9wqRgmuhvIcC7mngeTaKaVFaq/OEJsxUgIgTicCShjLbs2H76bxQSHH+8GVyoRubwzRr56IRKQM49E="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/one-webcrypto_1.0.0_1634291834141_0.9042848713446474"},"_hasShrinkwrap":false},"1.0.1":{"name":"one-webcrypto","version":"1.0.1","description":"Import the webcrypto API as a single module in both nodejs and browsers.","repository":{"type":"git","url":"git+https://github.com/fission-suite/one-webcrypto.git"},"author":{"name":"Philipp Krüger","email":"philipp@fission.codes"},"license":"MIT","types":"index.d.ts","main":"dynamic.cjs","exports":{".":{"browser":"./browser.mjs","import":"./node.mjs","require":"./node.cjs"},"./package.json":"./package.json"},"dependencies":{},"gitHead":"416cfed860194b78de6ed22d86ab17ae5690b2d9","bugs":{"url":"https://github.com/fission-suite/one-webcrypto/issues"},"homepage":"https://github.com/fission-suite/one-webcrypto#readme","_id":"one-webcrypto@1.0.1","_nodeVersion":"16.9.0","_npmVersion":"7.22.0","dist":{"integrity":"sha512-yFtrnpAgreBUDgEM/iTMGXwCnyyo/zwTOly/Pqx8T8TFd79QUv0OI+WkVMvCVgBg5Eja7Uo12x2M7v7RJPba8A==","shasum":"023dcf8983276dc568a0ecfc71aa71ad045190b8","tarball":"https://registry.npmjs.org/one-webcrypto/-/one-webcrypto-1.0.1.tgz","fileCount":7,"unpackedSize":3257,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD77dnwM5ow1zo/xPwfeLjUW8sktn1XsLEMukMOskc74QIgEIb490z6aLB1XEjWaOcI6Rpz2TizBZqoQtGX4/2PhA4="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/one-webcrypto_1.0.1_1634294305337_0.626854024926669"},"_hasShrinkwrap":false},"1.0.2":{"name":"one-webcrypto","version":"1.0.2","description":"Import the webcrypto API as a single module in both nodejs and browsers.","repository":{"type":"git","url":"git+https://github.com/fission-suite/one-webcrypto.git"},"author":{"name":"Philipp Krüger","email":"philipp@fission.codes"},"license":"MIT","types":"index.d.ts","main":"dynamic.cjs","exports":{".":{"browser":"./browser.mjs","import":"./node.mjs","require":"./node.cjs"},"./package.json":"./package.json"},"dependencies":{},"gitHead":"20441992baef7854dfd877d7ff0e860fdb92b373","bugs":{"url":"https://github.com/fission-suite/one-webcrypto/issues"},"homepage":"https://github.com/fission-suite/one-webcrypto#readme","_id":"one-webcrypto@1.0.2","_nodeVersion":"16.11.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-7RVA4EE7hPSy0KCDYouCCSN5dwH1ThB1WQhiydtZsslgZoJvaBGhO27QpnL+ZDUleyBq/9jkIhyvEJxEu96KbQ==","shasum":"005443714b7b615405ee876afe526b056ac6d79f","tarball":"https://registry.npmjs.org/one-webcrypto/-/one-webcrypto-1.0.2.tgz","fileCount":7,"unpackedSize":3309,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNLxS81hKtbp3wj9ToyEscHlbyLqS4pqazkEFCdB0iLAIhAN1Nv1ii2SB/ZYHVuvovC9WrzF1FlEfS48+/xNenA+pi"}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/one-webcrypto_1.0.2_1635854204517_0.9957668509572934"},"_hasShrinkwrap":false},"1.0.3":{"name":"one-webcrypto","version":"1.0.3","description":"Import the webcrypto API as a single module in both nodejs and browsers.","repository":{"type":"git","url":"git+https://github.com/fission-suite/one-webcrypto.git"},"author":{"name":"Philipp Krüger","email":"philipp@fission.codes"},"license":"MIT","types":"index.d.ts","main":"dynamic.cjs","exports":{".":{"browser":"./browser.mjs","import":"./node.mjs","require":"./node.cjs"},"./package.json":"./package.json"},"dependencies":{},"gitHead":"1a2ee373d4141e6d295cd10e986b3cafe8cc64eb","bugs":{"url":"https://github.com/fission-suite/one-webcrypto/issues"},"homepage":"https://github.com/fission-suite/one-webcrypto#readme","_id":"one-webcrypto@1.0.3","_nodeVersion":"16.11.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-fu9ywBVBPx0gS9K0etIROTiCkvI5S1TDjFsYFb3rC1ewFxeOqsbzq7aIMBHsYfrTHBcGXJaONXXjTl8B01cW1Q==","shasum":"f951243cde29b79b6745ad14966fc598a609997c","tarball":"https://registry.npmjs.org/one-webcrypto/-/one-webcrypto-1.0.3.tgz","fileCount":7,"unpackedSize":3359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh211ZCRA9TVsSAnZWagAA/UgP/j36AjduX8TaDFjMs3Lm\nWaRRIOjvlmopwe2i0gKm8OCUj4Bfjoo9XgRu7dMCe5CtNv6PnBbYldsS+pgz\nQgMLiAIincASYtMjw0wieKmh4WbgBieYbXyjvy6brEhh3ioJVT3naK2TO9Bv\n3Nkf5mzZsIwXRxooSeeMnO+632Be1rlj8WzM9eO5ApJnswlqNauELDQkfrbY\nRfGUL1AIwgVIgQ0idX7eLjua7MfiI7KW40DK/B+sWP1YA/ra53hegv/bRApT\nhlJa85y0EvNckTdkLB9svm4RgkUaO9wSFQMH2uB7bZTbZ7y+Pw5yFuSqHgCE\ndG+4LxJc1re4CnarATLNnqXvv0qb+BcLThy1VbUjnQCB2diJZMqmaPiEJ1/b\n9hqKWtHowKNCLbUh9u3YGgB9fK7tjYRACt80QfBj8lNMPKQuYdoe67UMh885\nEwm79chwVmAu+V/wokrUcmlOyM1L7qq5cK70h4mI4Vo25rHRQRGI8m/NiqAy\n8YVE4c/MJrnY2dsTD4WgZO1nTJhUJi2I3v/FIhFPQxfV2S4QinMfdpq0msRI\nCM4ESr8D/xblfQiazJ2ZI6bkZt8KsCAsErDbhtJ81yy+qan05mZD3UxqLcL8\nGcEBxByR3YVkalWR1IVc9nIb2vPSVKI7QKO8KLzOhANNz7PwrkrIGyzCugEM\nzcfp\r\n=QG9x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmXqjtjLKInvP1383anMjYzM/7UGwQil9rw4FYSuUQEAiEA0w89/vC4hd73XfVECtip5xA2G0lPKJRgVnE1z3OmO2g="}]},"_npmUser":{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"},"directories":{},"maintainers":[{"name":"philipp-fission","email":"philipp.krueger1+fissionnpm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/one-webcrypto_1.0.3_1635854823291_0.6987450709574206"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-15T09:57:14.141Z","1.0.0":"2021-10-15T09:57:14.281Z","modified":"2022-10-17T18:34:56.466Z","1.0.1":"2021-10-15T10:38:25.503Z","1.0.2":"2021-11-02T11:56:44.660Z","1.0.3":"2021-11-02T12:07:03.417Z"},"maintainers":[{"email":"av@andrewvivash.com","name":"andrewvivash"},{"email":"appcypher@outlook.com","name":"appcypher"},{"email":"icid.asset@gmail.com","name":"icidasset"},{"email":"quinn@quinnwilton.com","name":"quinnwilton"},{"email":"brian@fission.codes","name":"bgins-fission"},{"email":"be.zelenka@gmail.com","name":"expede"},{"email":"walkah@walkah.net","name":"walkah"},{"email":"philipp.krueger1+fissionnpm@gmail.com","name":"philipp-fission"}],"description":"Import the webcrypto API as a single module in both nodejs and browsers.","homepage":"https://github.com/fission-suite/one-webcrypto#readme","repository":{"type":"git","url":"git+https://github.com/fission-suite/one-webcrypto.git"},"author":{"name":"Philipp Krüger","email":"philipp@fission.codes"},"bugs":{"url":"https://github.com/fission-suite/one-webcrypto/issues"},"license":"MIT","readme":"# one-webcrypto\n\nThe [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is available in [most browsers](https://caniuse.com/cryptography), under a global variable:\n\n```js\n// in web pages\nconst webcrypto = window.crypto\n// in web workers, etc.\nconst webcrypto = self.crypto\n// or generally under\nconst webcrypto = globalThis.crypto\n```\n\nIt is also [available in NodeJS](https://nodejs.org/api/webcrypto.html#webcrypto_web_crypto_api) since version 15.\n\nHowever, it is accessed differently:\n\n```js\n// in node with commonjs\nconst webcrypto = require(\"crypto\").webcrypto\n// in node with ES Modules\nimport crypto from \"crypto\"\nconst webcrypto = crypto.webcrypto\n```\n\nThese different ways of getting access to valuable cryptographic primitives (see `webcrypto.subtle`) accross platforms (node & browsers) are hard to get right.\n\n\n## Usage\n\nWith this package, you can just import the [WebCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) like so:\n\n```js\nimport { webcrypto } from \"one-webcrypto\"\n\nwebcrypto.getRandomValues( //...\nawait webcrypto.subtle.generateKey( //...\n```\n\nOr with CommonJS:\n\n```js\nconst { webcrypto } = require(\"one-webcrypto\")\n```\n\n\n## Compatibility Issues\n\nThis package uses a fairly new package.json standard field, the `exports` field.\n\nRead more about it:\n* [\"export maps\" in nodejs documentation](https://nodejs.org/api/packages.html#packages_package_entry_points). \n* [\"package exports\" in webpack documentation](https://webpack.js.org/guides/package-exports/)\n* [original \"pkg exports\" proposal](https://github.com/jkrems/proposal-pkg-exports/)\n\nWe're also making use of webpack's pseudo-standard of the [\"browser\" flag](https://webpack.js.org/guides/package-exports/#target-environment) for imports.\n\nSo if your environment doesn't support that, it _may_ or _may not_ work.\n\nWe know that this setup works (*should work*) with\n* NodeJS 15+ (thus also e.g. mocha)\n* ESBuild\n* Webpack 5\n* Vite\n* SvelteKit\n* Snowpack\n* Parcel 2\n\nWe know that this setup can have issues with\n* Create React App\n\nIf you have **any experience** (whether it supports the claims above or not), **please create an issue**.\nThe idea is to help each other out in these crazy bundler times and document what works and what doesn't. :)\n","readmeFilename":"README.md"}