install-optional
v1.4.5
Published
Install and remove optional dependencies
Maintainers
Readme
install-optional
Install and remove optional dependencies
npm install install-optionalIn a CommonJS .cjs file:
var optional = require('install-optional');
// Remove optional dependencies with @esbuild/ in their name.
optional.removeSync('esbuild', '@esbuild/');
// Install optional dependencies for this platform synchronously.
optional.installSync('esbuild', process.platform + '-' + process.arch);
// Install optional dependencies for this platform asynchronously.
optional.install('esbuild', process.platform + '-' + process.arch, function (err) {
if (err) throw err;
});