@vltpkg/vlx
Executable management for vlt exec.
Usage
Overview
This is a tool that provides the global installs used by vlt exec
(that is, when it's not a local installed dependency).
Usage
import * as vlx from '@vltpkg/vlx'
const conf: LoadedConfig = blahblahblah()
const { positionals, options } = conf
const promptFn = async (pkgSpec: Spec, path: string) => {
const result = await createInterface(
process.stdin,
process.stdout,
).question(`Installing ${pkgSpec} in ${path}, is this ok? (y)`)
process.stdin.pause()
return result
}
const arg0 = await vlx.resolve(positionals, options, promptFn)
if (arg0 === undefined) {
doInteractiveShellOrWhatever()
} else {
runTheCommandOrWhatever([arg0, ...positionals.slice(2)])
}
const info = await vlx.install('somepkg@somespec', options)
const removed = await vlx.delete(['somepkg'], remover, options)
const removed = await vlx.delete(['somepkg'], remover, options)
const installPaths = await vlx.list()
const {
manifest,
path,
resolved,
arg0,
} = await vlx.info(path, options)