Bootstraps node projects by given config
import { Bootstrapper } from 'package-bootstrapper';
const appName = 'test-app';
Bootstrapper(appName).bootstrap();
.bootstrap(options:BootstrapOptions)
type BootstrapOptions = Partial<{
packageJson: Partial<{
scripts: Record<string, string>;
dependencies: string[];
devDependencies: string[];
params: Record<string, any>;
}>;
files: Record<string, string>;
postScripts: string[];
}>;
packageJson
-
scripts
: override default scripts -
dependencies
: an array of dependencies to install -
devDependencies
: an array of devDependencies to install -
params
: additional params to attach topackage.json
files
defines files to be created on bootstrap. each key is a file path and each value is the corresponding file content
postScripts
scripts to run post initialization