@putout/operator-rename-files
🐊Putout operator adds ability to rename files to plugins
Last updated 2 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/operator-rename-files 
SYNC missed versions from official npm registry.

@putout/operator-rename-files NPM version

🐊Putout operator adds ability to rename files to plugins.

Install

npm i putout @putout/operator-rename-files

API

If you want to create 🐊Putout plugin that will rename files according to your needs just use for ESM:

const {operator} = require('putout');
const {renameFiles} = operator;

module.exports = renameFiles({
    type: 'module',
    mask: '*.mjs',
    rename(name) {
        return name.replace(/mjs$/, 'js');
    },
});

And for CommonJS:

module.exports = renameFiles({
    type: 'commonjs',
    mask: '*.cjs',
    rename(name) {
        return name.replace(/cjs$/, 'js');
    },
});

When you do not need to check type field of package.json, avoid type field:

module.exports = renameFiles({
    mask: '*.cjs',
    rename(name) {
        return name.replace(/cjs$/, 'js');
    },
});

You can also use redlint directly.

License

MIT

Current Tags

  • 6.2.1                                ...           latest (10 months ago)

15 Versions

  • 6.2.1                                ...           10 months ago
  • 6.2.0                                ...           10 months ago
  • 6.1.2                                ...           10 months ago
  • 6.1.1                                ...           10 months ago
  • 6.1.0                                ...           10 months ago
  • 6.0.3                                ...           10 months ago
  • 6.0.2                                ...           a year ago
  • 6.0.1                                ...           a year ago
  • 6.0.0                                ...           a year ago
  • 5.0.0                                ...           a year ago
  • 4.0.0                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Total 26
Today 0
This Week 0
This Month 22
Last Day 0
Last Week 15
Last Month 1
Dependencies (1)
Dev Dependencies (13)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE