{"_id":"@dario-hacking/vite-6-alpha-environment-provider-node-vm","_rev":"3-705c6c85ed0093eff984e1e4ad289a64","name":"@dario-hacking/vite-6-alpha-environment-provider-node-vm","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@dario-hacking/vite-6-alpha-environment-provider-node-vm","version":"0.0.1","_id":"@dario-hacking/vite-6-alpha-environment-provider-node-vm@0.0.1","maintainers":[{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"}],"homepage":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations#readme","bugs":{"url":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations/issues"},"dist":{"shasum":"d67d5368171f2b8cba1f2e08d3b55c7583fe82a7","tarball":"https://registry.npmjs.org/@dario-hacking/vite-6-alpha-environment-provider-node-vm/-/vite-6-alpha-environment-provider-node-vm-0.0.1.tgz","fileCount":4,"integrity":"sha512-gbzpINNGnM8aTpWsb8a+X3GZtvQeNlnCdsDV/8Z5hg9EELPBwbz/uILPwMmNeVwZ/EhhrrUnNVPXYNNmSYGduw==","signatures":[{"sig":"MEQCICE8liTGyKFbdGHoI1b/cS+H1xXHJtZFcATosTCRKN/OAiB0UJ94pQjVW0r8s/Lgi7Gc81iuSo80GuwHz0vvMZkXVA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6586},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"23df5c5b0f56214a76281377774e0afed4241dc9","scripts":{"build":"tsup","build:watch":"tsup --watch"},"_npmUser":{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"},"repository":{"url":"git+https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations.git","type":"git","directory":"packages/vite-environment-provider-node-vm"},"_npmVersion":"10.2.4","description":"Package that exports a `nodeVmEnvironmentProvider` function that can be used to set a Vite Environment to run code inside a [Node.js `vm` module](https://nodejs.org/api/vm.html).","directories":{},"_nodeVersion":"20.11.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vite":"^6.0.0-alpha.11","esbuild":"^0.15.3","typescript":"^5.0.4","@types/node":"^20.11.19"},"_npmOperationalInternal":{"tmp":"tmp/vite-6-alpha-environment-provider-node-vm_0.0.1_1717172756121_0.7773066404288498","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@dario-hacking/vite-6-alpha-environment-provider-node-vm","version":"0.0.2","_id":"@dario-hacking/vite-6-alpha-environment-provider-node-vm@0.0.2","maintainers":[{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"}],"homepage":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations#readme","bugs":{"url":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations/issues"},"dist":{"shasum":"0800aa15eef4d39683c1b77303a0b94509e1541c","tarball":"https://registry.npmjs.org/@dario-hacking/vite-6-alpha-environment-provider-node-vm/-/vite-6-alpha-environment-provider-node-vm-0.0.2.tgz","fileCount":4,"integrity":"sha512-EyHeDqhWfP6mhnYjHpshGZusyZEk+WmMCCpPGh+9kyntzCKWX4UcuoT+s5JxaUcAHoodYfZ6cI/2y/2+gCxXPQ==","signatures":[{"sig":"MEUCIC1duCQY2jpETBQgF8n69H4OCFYDsiaPHoaV/HWT+rzjAiEA/adx5CMivj7YfSRgfBKS7Zi/jBMt1SJNCMRxhpF7kLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8110},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"2f240704eeff851fc9ecf7252858130dd459f045","scripts":{"build":"tsup","build:watch":"tsup --watch"},"_npmUser":{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"},"repository":{"url":"git+https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations.git","type":"git","directory":"packages/vite-environment-provider-node-vm"},"_npmVersion":"10.2.4","description":"Package that exports a `nodeVmEnvironmentProvider` function that can be used to set a Vite Environment to run code inside a [Node.js `vm` module](https://nodejs.org/api/vm.html).","directories":{},"_nodeVersion":"20.11.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vite":"^6.0.0-alpha.11","esbuild":"^0.15.3","typescript":"^5.0.4","@types/node":"^20.11.19"},"_npmOperationalInternal":{"tmp":"tmp/vite-6-alpha-environment-provider-node-vm_0.0.2_1717695823233_0.26367682715679575","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@dario-hacking/vite-6-alpha-environment-provider-node-vm","version":"0.0.3","_id":"@dario-hacking/vite-6-alpha-environment-provider-node-vm@0.0.3","maintainers":[{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"}],"homepage":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations#readme","bugs":{"url":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations/issues"},"dist":{"shasum":"61514a2f970b2a6a813fa4f7719057a83b10c87f","tarball":"https://registry.npmjs.org/@dario-hacking/vite-6-alpha-environment-provider-node-vm/-/vite-6-alpha-environment-provider-node-vm-0.0.3.tgz","fileCount":4,"integrity":"sha512-M8hh3YDgz/BNdEuC89/NqVmNrfhzR85ExKcFdCskYUUm8IzIexyRjkSLsuXcMDazmwK48I1qE910qwUpka/dBg==","signatures":[{"sig":"MEUCIQDygehjlG8pvYBdBdXZu+K7Qj/biNHsFPuVSjLWRyYUSAIgP6tjPSarKiYSEoo6TSBOruJ9CjNW8KYlueVMHTWVkb0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7659},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"5277982f4f09d5eff8eec578d6b72dc1ea6fc9fa","scripts":{"build":"tsup","build:watch":"tsup --watch"},"_npmUser":{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"},"repository":{"url":"git+https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations.git","type":"git","directory":"packages/vite-environment-provider-node-vm"},"_npmVersion":"10.2.4","description":"Package that exports a `nodeVmEnvironmentProvider` function that can be used to set a Vite Environment to run code inside a [Node.js `vm` module](https://nodejs.org/api/vm.html).","directories":{},"_nodeVersion":"20.11.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vite":"^6.0.0-alpha.18","esbuild":"^0.15.3","typescript":"^5.0.4","@types/node":"^20.11.19"},"_npmOperationalInternal":{"tmp":"tmp/vite-6-alpha-environment-provider-node-vm_0.0.3_1723804646374_0.09324146016023649","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@dario-hacking/vite-6-alpha-environment-provider-node-vm","version":"0.0.4","repository":{"type":"git","url":"git+https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations.git","directory":"packages/vite-environment-provider-node-vm"},"main":"dist/index.js","type":"module","scripts":{"build":"tsup","build:watch":"tsup --watch"},"devDependencies":{"@types/node":"^20.11.19","tsup":"^8.0.2","typescript":"^5.1.6"},"peerDependencies":{"vite":"^6.0.0-alpha.18"},"_id":"@dario-hacking/vite-6-alpha-environment-provider-node-vm@0.0.4","gitHead":"8540014b3f0dd6295b2c91303e64320c1e31fa7d","types":"./dist/index.d.ts","description":"Package that exports a `nodeVmEnvironmentProvider` function that can be used to set a Vite Environment to run code inside a [Node.js `vm` module](https://nodejs.org/api/vm.html).","bugs":{"url":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations/issues"},"homepage":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-WDsibrb9tRZHaEAcoNkpvAnvp8Icmyh4ntptju4waFq0rUCKLeMpbvJOo7gPraee84dmg8IP6x2CcpxCdgRDUA==","shasum":"d6a5304456a1a031d27f3420948dcbeb9eaa671a","tarball":"https://registry.npmjs.org/@dario-hacking/vite-6-alpha-environment-provider-node-vm/-/vite-6-alpha-environment-provider-node-vm-0.0.4.tgz","fileCount":4,"unpackedSize":7661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD74bV/uzLyibfwWboWSxkfoUcAWZqmX+kvHz2qCPqWegIhAJJV7jD0r5KktoJbG063l9UO5Z/esG+yg5LJ6zvQR0LX"}]},"_npmUser":{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"},"directories":{},"maintainers":[{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-6-alpha-environment-provider-node-vm_0.0.4_1723829725449_0.5026062448993347"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-31T16:25:56.038Z","modified":"2024-08-16T17:35:25.923Z","0.0.1":"2024-05-31T16:25:56.310Z","0.0.2":"2024-06-06T17:43:43.435Z","0.0.3":"2024-08-16T10:37:26.592Z","0.0.4":"2024-08-16T17:35:25.737Z"},"bugs":{"url":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations/issues"},"homepage":"https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations#readme","repository":{"type":"git","url":"git+https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations.git","directory":"packages/vite-environment-provider-node-vm"},"description":"Package that exports a `nodeVmEnvironmentProvider` function that can be used to set a Vite Environment to run code inside a [Node.js `vm` module](https://nodejs.org/api/vm.html).","maintainers":[{"name":"dario.piotrowicz","email":"dario.piotrowicz@gmail.com"}],"readme":"# Vite Environment Provider Node-VM\n\nPackage that exports a `nodeVmEnvironmentProvider` function that can be used to set a Vite Environment to run code inside a [Node.js `vm` module](https://nodejs.org/api/vm.html).\n\n> [!NOTE]\n> Based on the [vite@6.0.0-alpha.18](https://www.npmjs.com/package/vite/v/6.0.0-alpha.18) Environment API implementation.\n\n## Package Usage\n\nThe package exposes the `nodeVMEnvironmentProvider` function that can be used to create new environments that run code inside a node vm:\n\n```ts\nenvironments: {\n  myEnvironment: nodeVMEnvironmentProvider(),\n}\n```\n\nthis sets both a `dev` and a `build` environments (of course users can also process the `nodeVMEnvironmentProvider` returned value to tweak the returned environments and/or use only one of them).\n\nIn the case of the dev environment, the environment instance is enhanced with an `api` field that contains a `getHandler` method, this is what can then be used to handle incoming requests (making sure that they are run inside the node vm):\n\n```ts\nconst handler = await devEnv.api.getHandler({\n  entrypoint: myEntrypoint,\n});\n```\n\nYou can see usage examples [here](../../examples/dummy-framework/frameworkPlugin.ts) and [here](https://github.com/dario-piotrowicz/remix/blob/2.9.1-vite-env-4/packages/remix-dev/vite/plugin.ts).\n","readmeFilename":"README.md"}