plop-pack-remove

1.1.0 • Public • Published

plop-pack-remove

A plop action which allows you to remove individual files or many files (via glob pattern).

Installation

yarn add plop-pack-remove
npm i plop-pack-remove

Example

module.exports = function(plop) {
  // Loads the gitInit action type
  plop.load('plop-pack-remove');

  plop.setGenerator('generate', {
    prompts: [
        // ...
    ],
    actions: [{
      type: 'remove',
      path: 'some/file/path.txt',
      force: true // Allow removal of files outside of the project root. Defaults to false
      skipIfNonexistent: true // When true it will skip if the file does not exist. When false, it will throw an error. Defaults to false
    },
    {
      type: 'removeMany',
      path: 'some/directory/**',
    },
    {
      type: 'removeMany',
      path: ['some/directory/**', 'some/other/directory/**', '/tmp/outside/of/project/specific-file.txt'],
      force: true // Allow removal of files outside of the project root. Defaults to false
    }];
  })
}

/plop-pack-remove/

    Package Sidebar

    Install

    npm i plop-pack-remove

    Weekly Downloads

    3,407

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    3.19 kB

    Total Files

    4

    Last publish

    Collaborators

    • sharpie