版博士V2.0程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122
  1. Node-Plop
  2. ======
  3. [![npm](https://img.shields.io/npm/v/node-plop.svg)](https://www.npmjs.com/package/node-plop)
  4. [![GitHub actions](https://img.shields.io/github/workflow/status/plopjs/node-plop/test)](https://github.com/plopjs/node-plop/actions/workflows/test.yml)
  5. This is an early publication of the plop core logic being removed from the CLI tool. Main purpose for this is to make it easier for others to automate code generation through processes and tools OTHER than the command line. This also makes it easier to test the code functionality of PLOP without needing to test via the CLI interface.
  6. This is the backend code that drives the plop CLI tool using node-plop.
  7. ``` javascript
  8. import nodePlop from 'node-plop';
  9. // load an instance of plop from a plopfile
  10. const plop = await nodePlop(`./path/to/plopfile.js`);
  11. // get a generator by name
  12. const basicAdd = plop.getGenerator('basic-add');
  13. // run all the generator actions using the data specified
  14. basicAdd.runActions({name: 'this is a test'}).then(function (results) {
  15. // do something after the actions have run
  16. });
  17. ```