Ready-made tasks and shared services for ETL jobs.
@metreeca/gear brings ready-made @metreeca/flow tasks for acquiring data from external sources and converting it into the values a pipeline works on. The tasks run under a pluggable job executor, which supplies the shared services they draw on.
Pipelines are server-side workloads targeting Node.js 22 or later, relying on facilities such
as the filesystem, the process environment and fetch. The packages are not intended for the browser.
npm install @metreeca/gear # job execution runtime and shared services
npm install @metreeca/gear-<type> # task package, one per input type
TypeScript consumers must use "moduleResolution": "nodenext"/"node16"/"bundler" in tsconfig.json.
The legacy "node" resolver is not supported.
Install the core package, then add a task package for each input type the pipeline handles. Task packages are self-contained leaves, each pulling in only the libraries its own input type needs.
| Package | Description |
|---|---|
| @metreeca/gear | Job execution runtime and shared services |
| @metreeca/gear-url | URL processing tasks |
| @metreeca/gear-json | JSON processing tasks |
| @metreeca/gear-xml | XML and HTML processing tasks |
| @metreeca/gear-csv | CSV processing tasks |
Each package documents its own API in its README and API reference; for complete coverage, see the API reference.
A job binds the services it relies on, then drives a @metreeca/flow feed through the tasks provided by the input packages:
import { bind, executor, service } from "@metreeca/gear";
import { createDotVault, createVault } from "@metreeca/gear/vault";
import { csv } from "@metreeca/gear-csv";
import { fetch } from "@metreeca/gear-url";
import { pipe } from "@metreeca/flow";
import { items } from "@metreeca/flow/feeds";
import { each } from "@metreeca/flow/sinks";
await executor(
bind(createVault, createDotVault)
)(async () => pipe(items([await service(createVault)("data-url")])
(fetch())
(csv())
(each(record => console.log(record)))
));
This project is licensed under the Apache 2.0 License – see LICENSE file for details.