{"_id":"@alt-javascript/camel-lite-component-file","_rev":"3-daf6ecfb12efdaa73249a2b84b1a47a7","name":"@alt-javascript/camel-lite-component-file","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.2":{"name":"@alt-javascript/camel-lite-component-file","version":"1.0.2","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","file","io","component"],"author":{"name":"Craig Parravicini"},"_id":"@alt-javascript/camel-lite-component-file@1.0.2","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"},{"name":"Apache Camel — design inspiration and pattern source"}],"homepage":"https://github.com/alt-javascript/camel-lite#readme","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"dist":{"shasum":"3af838ff313ca873b55f008849dc4dc41eaaa3fd","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-component-file/-/camel-lite-component-file-1.0.2.tgz","fileCount":8,"integrity":"sha512-r2St5RkTVzdJ8duJQpXd6v21ev2VXwbaTE+A9JvfVpxgqzLh8m2iNIUUua6VhjQo6toBGZcmEfhxIeMzXJPN2g==","signatures":[{"sig":"MEUCIA+9Bg4SwPTWkkilIqSEKr4VAZjFug9IbhzGcZpNjVdOAiEAhJlHWl8jxczJXOSAj+e76ZBwmifS5rrgMq0MTtEdaBo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-component-file@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15219},"type":"module","exports":{".":"./src/index.js"},"gitHead":"9f948b9f02d85c9f593229684c475cd209369f2c","scripts":{"test":"node --test"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/camel-lite.git","type":"git"},"_npmVersion":"11.9.0","description":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@alt-javascript/common":"^3.0.7","@alt-javascript/config":"^3.0.7","@alt-javascript/logger":"^3.0.7","@alt-javascript/camel-lite-core":"1.0.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/camel-lite-component-file_1.0.2_1774595600290_0.4513765008551165","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@alt-javascript/camel-lite-component-file","version":"1.1.0","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","file","io","component"],"author":{"name":"Craig Parravicini"},"_id":"@alt-javascript/camel-lite-component-file@1.1.0","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"}],"homepage":"https://github.com/alt-javascript/camel-lite#readme","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"dist":{"shasum":"52d8d412c98193d3640b8cbeb59abc0d95468d77","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-component-file/-/camel-lite-component-file-1.1.0.tgz","fileCount":8,"integrity":"sha512-4X8LVb1xdZSD8mQRKq2VqJ9oojXg02LpMEiPSqig8EqbYWK9mQXLgUtyQ3hDxsj+7yE2OAzd4mENTpKVeMl3jw==","signatures":[{"sig":"MEQCIAVLinLsh+bHfvNTCSWV4zK7BwdocG+0+1y1n53J2yk3AiAxhIwtDfH4tHMKpaTQi9YjlsTdl9x7/j5MtcEKLxxuLA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-component-file@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15157},"type":"module","exports":{".":"./src/index.js"},"gitHead":"c227a03632d4b1e2f93b4562c7e74f52ba87d340","scripts":{"test":"node --test"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/camel-lite.git","type":"git"},"_npmVersion":"11.9.0","description":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@alt-javascript/common":"^3.0.7","@alt-javascript/config":"^3.0.7","@alt-javascript/logger":"^3.0.7","@alt-javascript/camel-lite-core":"1.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/camel-lite-component-file_1.1.0_1774763505136_0.38698460328384154","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@alt-javascript/camel-lite-component-file","version":"1.1.1","type":"module","exports":{".":"./src/index.js"},"dependencies":{"@alt-javascript/logger":"^3.0.7","@alt-javascript/config":"^3.0.7","@alt-javascript/common":"^3.0.7","@alt-javascript/camel-lite-core":"1.1.1"},"scripts":{"test":"node --test"},"repository":{"type":"git","url":"git+https://github.com/alt-javascript/camel-lite.git"},"author":{"name":"Craig Parravicini"},"contributors":[{"name":"Claude","url":"Anthropic"}],"keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","file","io","component"],"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"gitHead":"ff8501eed381d38ac20f56aea721274466d64212","_id":"@alt-javascript/camel-lite-component-file@1.1.1","description":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"homepage":"https://github.com/alt-javascript/camel-lite#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-fkNjguyyMMh3Yw2tpPvGdS8sHRRSG/yNa/0m+Y8Tq/lrSU+WveFMZ3LeR9pb60S0yD55QfDY8mYi2ql7EwW9gA==","shasum":"b8a72a38fd0b2a2daa777ed4bc37235ced4c3acc","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-component-file/-/camel-lite-component-file-1.1.1.tgz","fileCount":8,"unpackedSize":15157,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-component-file@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC/TrqeIIxqpvKfbEFpiDhqmGYiKEOrkFZ2bv3hDtl/VgIgULOyBqGr/Ygy3+o93A28QmXbzyfYY8EGLkuD+eEvxck="}]},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"directories":{},"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/camel-lite-component-file_1.1.1_1774764459263_0.41765152097440517"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T07:13:20.216Z","modified":"2026-03-29T06:07:39.692Z","1.0.2":"2026-03-27T07:13:20.431Z","1.1.0":"2026-03-29T05:51:45.328Z","1.1.1":"2026-03-29T06:07:39.402Z"},"bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"author":{"name":"Craig Parravicini"},"homepage":"https://github.com/alt-javascript/camel-lite#readme","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","file","io","component"],"repository":{"type":"git","url":"git+https://github.com/alt-javascript/camel-lite.git"},"description":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","contributors":[{"name":"Claude","url":"Anthropic"}],"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## What\n\nFile read (consumer: polls a directory) and write (producer: writes exchange body to a file). Supports configurable file name, character encoding, and auto-delete after read.\n\n## Install\n\n```sh\nnpm install camel-lite-component-file\n```\n\n## URI Syntax\n\n```\nfile:/absolute/path[?fileName=out.txt&charset=utf8&delete=false]\n```\n\n| Parameter  | Default     | Description |\n|------------|-------------|-------------|\n| `fileName` | *(auto)*    | Output file name for producers. Consumers ignore this; all files in the directory are read. |\n| `charset`  | `utf8`      | Character encoding for reading/writing file content. |\n| `delete`   | `false`     | Consumer only: delete the source file after it has been successfully read. |\n\n## Usage\n\n**Producer — write exchange body to a file:**\n\n```js\nimport { CamelContext } from 'camel-lite-core';\nimport { FileComponent } from 'camel-lite-component-file';\n\nconst context = new CamelContext();\ncontext.addComponent('file', new FileComponent());\n\ncontext.addRoutes({\n  configure(ctx) {\n    ctx.from('direct:writeFile')\n      .to('file:/tmp/output?fileName=result.txt&charset=utf8');\n  }\n});\n\nawait context.start();\n\nconst template = context.createProducerTemplate();\nawait template.sendBody('direct:writeFile', 'Hello, file!');\n\nawait context.stop();\n```\n\n**Consumer — read files from a directory:**\n\n```js\ncontext.addRoutes({\n  configure(ctx) {\n    ctx.from('file:/tmp/inbox?delete=true')\n      .process(exchange => {\n        console.log('File content:', exchange.in.body);\n        console.log('File name:', exchange.in.getHeader('CamelFileName'));\n      });\n  }\n});\n```\n\n## See Also\n\n[camel-lite — root README](../../README.md)\n","readmeFilename":"README.md"}