UNPKG

@storm-stack/plugin-system

Version:

A library used to create and manage a plugin-styled architecture in a TypeScript application.

25 lines (24 loc) 636 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.install = exports.execute = void 0; var _ni = require("@antfu/ni"); var _execa = require("execa"); const execute = (command, rootPath) => { return (0, _execa.execaCommand)(command, { preferLocal: true, shell: true, stdio: "inherit", cwd: rootPath }); }; exports.execute = execute; const install = async (name, rootPath) => { await execute((0, _ni.getCommand)((await (0, _ni.detect)({ autoInstall: false, cwd: rootPath, programmatic: true })) ?? "npm", "install", [name]), rootPath); }; exports.install = install;