Skip to content

feat(micro-utilities): add p-pipe to replacements - #1258

Merged
43081j merged 2 commits into
e18e:mainfrom
maksimgm:feat/p-pipe
Nov 20, 2026
Merged

43081j merged 2 commits into
e18e:mainfrom
maksimgm:feat/p-pipe

Conversation

@maksimgm

Copy link
Copy Markdown
Contributor

🔗 Linked issue

closes #1188

📚 Description

adds p-pipe (~2.2M weekly downloads) to micro-utilities with a new snippet::async-pipe, using a for loop as suggested in the issue:

const pipe = (...fns) => async (input) => {
  let value = input;
  for (const fn of fns) {
    value = await fn(value);
  }
  return value;
};

checked against p-pipe@4.0.0 (3.1.0 has the same code) with sync/async/promise-returning fns and a rejection, same results. only difference: the package throws when called with no functions, the snippet just returns the input

43081j
43081j previously approved these changes Nov 20, 2026
@43081j
43081j merged commit eeee486 into e18e:main Nov 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Replacement]: p-pipe

2 participants