2.2.0 • Published 8 months ago

@putout/cli-match v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@putout/cli-match NPM version

Read .putout.json and convert rules into match.

Install

npm i @putout/cli-match
{
-   "rules": {
-       "remove-debugger": "on"
+   "match": {
+       "*.md": {
+           "remove-debugger": "on"
+       }
    }
}

Example

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);

License

MIT