$ cnpm install @putout/cli-match
Read .putout.json and convert rules into match.
npm i @putout/cli-match
{
- "rules": {
- "remove-debugger": "on"
+ "match": {
+ "*.md": {
+ "remove-debugger": "on"
+ }
}
}
import {cwd} from 'node:process';
import {readFile, writeFile} from 'node:fs/promises';
import match from '@putout/cli-match';
const {code, message} = await match({
pattern,
cwd: cwd(),
readFile, // optional
writeFile, // optional
});
console.log(message);
process.exit(code);
MIT
Copyright 2013 - present © cnpmjs.org | Home |