{"name":"@putout/engine-processor","version":"16.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout engine processor runner","homepage":"https://github.com/coderaiser/putout/tree/master/packages/engine-processor#readme","main":"lib/processor.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{"@putout/engine-loader":"^17.0.0","once":"^1.4.0","picomatch":"^4.0.2","try-to-catch":"^4.0.0"},"keywords":["putout","putout-engine"],"devDependencies":{"@putout/cli-process-file":"*","@putout/eslint-flat":"^3.0.0","@putout/plugin-travis":"*","@putout/processor-css":"*","@putout/test":"^15.0.0","c8":"^10.0.0","eslint":"^10.0.0-alpha.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^29.0.0","madrun":"^12.0.0","nodemon":"^3.0.1","putout":"*","supertape":"^11.0.3"},"peerDependencies":{"putout":"*"},"license":"MIT","engines":{"node":">=22"},"publishConfig":{"access":"public"},"_id":"@putout/engine-processor@16.0.0","gitHead":"f3e547e0f0ceba9b10daed9647b4b0c604e4b53e","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.21.1","_npmVersion":"11.4.2","dist":{"integrity":"sha512-xccdx+x6j5P4FSOEXpWfj8vtXnQyIupmn+SsyBk0savy3jI6zMxyap8fmf44ioV3fiR6jQZaUL1Rfgv4HCtxuw==","shasum":"60eb2caec3db5f6f0dfded95028f2fcc74ff6dcc","tarball":"http://registry-npm.ywwl.com/@putout/engine-processor/download/@putout/engine-processor-16.0.0.tgz","fileCount":4,"unpackedSize":8592,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE9X90xJGwqj2USOjOt2oh11vUpnr0FUrlPpgDiBBblUAiEAiJfWEZg14ffdmKkJo+BTOjVhJ30El9b5vq1rZie7+EQ="}],"size":3140,"noattachment":false,"key":"/@putout/engine-processor/-/@putout/engine-processor-16.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/engine-processor_16.0.0_1767357941694_0.6349071096107752"},"_hasShrinkwrap":false,"readme":"# @putout/engine-processor [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/engine-loader.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/engine-loader\"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) processor that runs all engines according to supported file types.\n\n```\nnpm i @putout/engine-processor\n```\n\n## Code Example\n\n```js\nconst {\n    getProcessorRunners,\n    runProcessors,\n} = require('@putout/engine-processor');\n\nconst processorRunners = await getProcessorRunners(processors);\nconst optionalLoader = async (a) => await import(a);\n\nawait getProcessorRunners(processors, optionalLoader);\n\nawait runProcessors({\n    name,\n    process,\n    options,\n    rawSource,\n    index,\n    length,\n    processorRunners, // optional\n    load, // when you need to override 'import()'\n});\n\n// returns\n({\n    isProcessed,\n    places,\n    processedSource,\n});\n```\n\n## Processor Example\n\nSimplest possible processor example can be written in both\n**CommonJS** or **ESM** and look like this:\n\n```js\nexport const files = ['*.js'];\n\nexport const find = (source) => {\n    return places;\n};\n\nexport const fix = (source) => {\n    return `modified ${source}`;\n};\n\nexport const branch = (source) => {\n    return [{\n        source,\n        startLine: 0,\n    }];\n};\n\nexport const merge = (source, list) => {\n    return list[0];\n};\n```\n\nInstead of `find` and `fix` you can export `lint`:\n\n```js\nimport eslint from '@putout/eslint';\n\nexport const files = ['*.js'];\n\nexport const lint = async (source, {fix}) => {\n    const [code, places] = await eslint(source, {\n        fix,\n    });\n    \n    return [code, places];\n};\n```\n\n## License\n\nMIT\n\n## License\n\nMIT\n","publish_time":1767357941820,"_cnpm_publish_time":1767357941820,"dist-tags":{"latest":"16.0.0"}}