@hackthedev/frontend-libs
v1.0.5
Published
Simple Frontend Lib installer
Readme
FrontendLibs
This library was made to easily download and "install" frontend libraries in NodeJS and store them in a custom path. The idea is to not link these libraries from online resource and instead save them locally so that applications that do use them can run without internet as well.
Usage
import FrontendLibs from "@hackthedev/frontend-libs";
let libDir = path.join(path.resolve(), "public", "js", "libs");
// installing multiple packages
const results = await FrontendLibs.installMultiple([
{ package: '@hackthedev/[email protected]', path: libDir },
{ package: '@hackthedev/[email protected]', path: libDir },
]);
results.forEach((r) => {
if(r?.success || r?.skipped){
console.log(r?.message)
}
else{
console.error(r?.message)
}
});
// Package @hackthedev/[email protected] already installed. Skipped.Alternatively:
const result = await FrontendLibs.install('@hackthedev/[email protected]', libDir);
// Package @hackthedev/[email protected] already installed. Skipped.