trough is middleware for building sync or async pipelines from plugin-style functions. It lets each middleware function inspect and optionally change the input passed to the next step. It’s useful when you want to run a sequence of operations with a consistent calling interface and a final `run` to execute the pipeline.
Project status
- The repository appears actively maintained in a light sense, with a recent update in 2024-02-05 (2.2.0) and earlier updates in 2022 (2.1.0) and 2021 (2.0.2).
- Apparent update cadence is irregular and slow, roughly 11 months between 2.0.2 and 2.1.0, then about 2 years until 2.2.0.
AI summary generated Today
Recent updates
2.2.0
2/5/2024Release 2.2.0 adds support for thenables in `wrap()` so promise-like return values (objects with a callable `then`) are handled like promises. The main source code was also reorganized by moving the implementation from `index.js` into `lib/index.js` and re-exporting from `index.js`. Beyond that, the release notes mostly mention documentation refactors, while the diff shows additional packaging and tooling configuration changes.
Features2.1.0
2/21/2022Version 2.1.0 focuses on type improvements and documentation updates. The only runtime-relevant change in the diff is that `wrap` now preserves the `this` value when calling middleware, enabling use of methods as middleware.
Features2.0.2
7/4/2021Release 2.0.2 is a small change focused on loosening TypeScript typings. The release notes mention adding some `any`s to fix types, and the code diff shows multiple public JSDoc typedefs changing from `unknown` to `any`.
2.0.1
6/25/2021Release 2.0.1 is a small patch release focused on fixing a regression related to middleware value propagation. The only explicit release note claims that wrong values were passed, and the code change aligns with that by updating how the output from one middleware becomes the input to the next.
2.0.0
5/11/2021v2.0.0 switches the project to ESM and adds JSDoc-based type annotations. The implementation also changes the public module API shape and how middleware results are interpreted (sync, Promise, Error, or callback-style).
BreakingFeatures1.0.5
1/25/2020Release 1.0.5 contains mostly documentation and repository metadata updates, plus changes to development tooling configuration. The release notes only mention “Refactor prose”, but the diff also bumps several devDependencies and adjusts the xo lint configuration.
1.0.4
5/14/2019Release 1.0.4 is primarily documentation and repository hygiene work: adding more badges, switching URLs to HTTPS, and renaming the license file to lowercase. The actual runtime library code changes are limited to comment formatting, with no apparent API or behavioral changes.
Features1.0.3
8/5/2018Release 1.0.3 primarily exposes the internal `wrap` functionality as a public API at `trough.wrap`. The implementation was split out into a new `wrap.js` module and wired back into `index.js`, and the README was updated accordingly.
Features1.0.2
4/15/2018Release 1.0.2 is described only as a code-style refactor. The actual diff shows largely formatting and tooling changes (prettier/xo/eslint style, CI config, and developer scripts), with no clear runtime API changes in the core middleware implementation.
1.0.1
7/9/2017Release 1.0.1 is presented as a small maintenance update focused on documentation cleanup and removing the `engines` limitation from `package.json`. The code diff shows the runtime source (`index.js`) is mostly comment/docblock changes, but the repository’s build and CI/tooling configuration also changed substantially.