Nodejs cli that helps to create a new plugin for flextool. Bootstrap a new project from a template.
NOTE: Template contain filenames that may be invalid on Windows, so use tools like Docker under Windows.
Install NodeJs and npm: https://nodejs.org/en/download/
# Tested with NodeJs v10.18.1
node -v
# TypeScript Installation
npm install -g typescriptInstall requirements:
# `--no-audit` because no need in security audit for project generator.
npm install --no-auditBuild:
npm run buildRun:
node ./dist/index.js \
--name my_plugin_name \
--copyright my_plugin_copyright \
--template external_plugin
# open generated folder based on `--name`
cd my_plugin_nameProject inspired by articles:
- https://dev.to/duwainevandriel/build-your-own-project-template-generator-59k4
- https://medium.com/@pongsatt/how-to-build-your-own-project-templates-using-node-cli-c976d3109129
- edit
TemplateDatainsrc/utils/template.ts QUESTIONSandCliOptionsinsrc/index.ts- Map
answerstoCliOptionslike so:const projectName = answers['name'];
- Pass new option into
template.renderlike so:template.render(contents, { projectName });
Use in contents of desired files ejs template syntax i.e. <%= projectName %>
Use in filenames of desired files ejs template syntax i.e. <%= projectName %>