@putout/cli-match

2.2.0 • Public • Published

@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

Readme

Keywords

Package Sidebar

Install

npm i @putout/cli-match

Weekly Downloads

4,903

Version

2.2.0

License

MIT

Unpacked Size

5.25 kB

Total Files

5

Last publish

Collaborators

  • coderaiser