@jesscss/awaitable-pipe 2.0.0-alpha.7 → 2.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# awaitable-pipe
|
|
1
|
+
# @jesscss/awaitable-pipe
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A tiny, strongly-typed pipe that stays synchronous until a step returns a Promise — with one optional error handler.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It’s a small utility from the [Jess](https://github.com/jesscss/jess) project (Less.js v5, a ground-up rewrite of the Less CSS preprocessor), where hot paths call functions that are usually — but not always — synchronous. It’s zero-dependency and usable on its own: it stays sync when everything is sync, and turns into a Promise only when something is async. No wrappers, no ceremony.
|
|
6
6
|
|
|
7
7
|
- **Stays sync when it can**: all-sync pipelines return a plain value
|
|
8
8
|
- **Goes async when it must**: any async input/step returns a Promise
|
|
@@ -12,12 +12,12 @@ A tiny, zero-dependency pipe with friendly types that “just works”: it stays
|
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
# or
|
|
18
|
-
npm i @jesscss/awaitable-pipe
|
|
15
|
+
```sh
|
|
16
|
+
npm install @jesscss/awaitable-pipe
|
|
19
17
|
```
|
|
20
18
|
|
|
19
|
+
Published to npm under both the `latest` and `alpha` dist-tags.
|
|
20
|
+
|
|
21
21
|
## Quick Start
|
|
22
22
|
|
|
23
23
|
```ts
|
|
@@ -181,5 +181,16 @@ const sum = await serialReduce(items, 0, async (acc, n, i) => {
|
|
|
181
181
|
// sum === 6
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
+
## Status
|
|
185
|
+
|
|
186
|
+
Alpha, as part of the Jess monorepo. Please
|
|
187
|
+
[report issues](https://github.com/jesscss/jess/issues).
|
|
188
|
+
|
|
189
|
+
## Links
|
|
190
|
+
|
|
191
|
+
- Repository: <https://github.com/jesscss/jess>
|
|
192
|
+
- Documentation: <https://jesscss.github.io/> (currently pre-alpha content)
|
|
193
|
+
|
|
184
194
|
## License
|
|
185
|
-
|
|
195
|
+
|
|
196
|
+
[MIT](https://github.com/jesscss/jess/blob/dev/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jesscss/awaitable-pipe",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.8",
|
|
4
4
|
"description": "A tiny, strongly-typed pipe that stays sync when possible and becomes a Promise when needed. With an optional single-point error handler.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.cjs",
|