extension_host: Add npm:install
capability (#35144)
This PR adds a new `npm:install` capability for installing npm packges in extensions. Currently all npm packages are allowed. Release Notes: - N/A
This commit is contained in:
parent
2a0170dc3c
commit
89e88c245e
5 changed files with 69 additions and 2 deletions
|
@ -745,6 +745,9 @@ impl nodejs::Host for WasmState {
|
|||
package_name: String,
|
||||
version: String,
|
||||
) -> wasmtime::Result<Result<(), String>> {
|
||||
self.capability_granter
|
||||
.grant_npm_install_package(&package_name)?;
|
||||
|
||||
self.host
|
||||
.node_runtime
|
||||
.npm_install_packages(&self.work_dir(), &[(&package_name, &version)])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue