@putout/operator-rename-files
🐊Putout operator adds ability to rename files to plugins
Last updated 7 months 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

  • 1.0.0                                ...           latest (7 months ago)

1 Versions

  • 1.0.0                                ...           7 months ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (13)
Dependents (1)

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