Comment driven line modifications
npm install linemod



CLI companion for linemod-core, a comment driven line modification tool.
``json`
"scripts": {
"test": "linemod -e new index.js lib/utils.js"
}
`bash`
npm install -g linemod
Then run it at on your files that has modifications:
`bash`
linemod -e new index.js lib/utils.js
If your command line supports globbing, then you can do:
`bash`
linemod -e new .js lib//.js
Use linemod-core directly.
* --extension / -e – required – the file extension used on the output files.
* --help / -h – prints all available flags--strict
* / -s – treats warnings as errors--verbose
* / -v – prints warnings and notices
All linemod-core modifications are supported. Linemods are added at the end of the line they are supposed to apply to.
Prefixes the line with whatever is specified after the keyword:
`javascript`
// linemod-add: import escape from 'stringify-entities';
Becomes:
`javascript`
import escape from 'stringify-entities';
Prefixes the line with whatever is specified after the keyword:
`javascript`
const exportedMethod = () => {}; // linemod-prefix-with: export
Becomes:
`javascript`
export const exportedMethod = () => {};
Replaces the line with whatever is specified after the keyword:
`javascript`
const escape = require('stringify-entities'); // linemod-replace-with: import escape from 'stringify-entities';
Becomes:
`javascript`
import escape from 'stringify-entities';
Simply removes the entire line.
Quite useful when combined with linemod-prefix-with:
`javascript`
const exportedMethod = () => {}; // linemod-prefix-with: export
module.exports = { exportedMethod }; // linemod-remove
Becomes:
`javascript``
export const exportedMethod = () => {};