use $$ to install npm packages
I need to document how to install an npm package so that it can be requested during an IJavascript session.
Alternatively, $$ could provide a function; e.g: $$.npm(), $$.yarn() or just $$.exec() to run a shell command in the session working directory.
Is there any progress on this? Did you find out how to nstall an npm package during a IJavascript session?
This here works for me as a workaround - it pollutes the global file system.
$$.async(); require('child_process').exec('npm install node-fetch', (f, o, e) => $$.done({ f, o, e }))
@freiit This should work: child_process.execSync("npm install node-fetch").
You may also find useful the discussion in #118 .
it pollutes the global file system
What do you mean by that?
Is there any progress on this?
I'm not working on this issue. Last time I checked npm and yarn didn't expose an API to JS. And I'm not convinced defining something like the below would be really useful:
$$.npm = function(args) {
return child_process.execSync("npm " + args);
};