Ready-made tasks and shared services for ETL jobs.
@metreeca/gear is a collection of ready-made @metreeca/flow tasks for retrieving remote or local sources and parsing the usual interchange formats, plus the job executor those tasks draw their shared services from. Key features include:
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 packages, among those listed above
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. These are self-contained leaf packages: each pulls in the core package transitively and only the libraries its own input type needs.
| Package | Description |
|---|---|
| @metreeca/gear | Job execution runtime and shared services |
| @metreeca/gear-url | URL processing tasks |
| (upcoming) | JSON processing tasks |
| (upcoming) | 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 { feed } from "@metreeca/flow/feeds";
import { forEach } from "@metreeca/flow/sinks";
await executor(
bind(createVault, createDotVault)
)(async () => pipe(feed([await service(createVault)("data-url")])
(fetch())
(csv())
(forEach(record => console.log(record)))
));
This project is licensed under the Apache 2.0 License – see LICENSE file for details.