Skip to content

Commit 1b1b49f

Browse files
committed
🐛 docs: update require name
1 parent 7921173 commit 1b1b49f

File tree

6 files changed

+707
-3945
lines changed

6 files changed

+707
-3945
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
tags:
88
- '!*' # Do not execute on tags
99
env:
10+
NAME: ${{vars.NAME}}
11+
EMAIL: ${{vars.EMAIL}}
12+
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
1013
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
1114
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
1215
FORCE_COLOR: 1
@@ -55,8 +58,7 @@ jobs:
5558
- uses: actions/setup-node@v2
5659
with:
5760
node-version: 18.x
58-
- run: git clone https://${GITHUB_TOKEN}@github.com/nodef/deploy "$HOME/deploy"
59-
- run: bash "$HOME/deploy/setup.sh"
61+
- uses: nodef/git-config.action@v1.0.0
6062
- run: npm i -g typescript typedoc
6163
- run: npm ci
6264
- run: npm run publish-docs
@@ -71,8 +73,9 @@ jobs:
7173
- uses: actions/setup-node@v2
7274
with:
7375
node-version: 18.x
74-
- run: git clone https://${GITHUB_TOKEN}@github.com/nodef/deploy "$HOME/deploy"
75-
- run: bash "$HOME/deploy/setup.sh"
76+
- uses: nodef/npm-config.action@v1.0.0
77+
with:
78+
entries: access = public
7679
- run: npm i -g typescript rollup typedoc browserify terser
7780
- run: npm ci
7881
- run: npm run publish-packages

README.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
A collection of ways for transforming async functions.<br>
1+
An [async function] is a function that delivers its [result asynchronously] (through [Promise]).<br>
22
📦 [Node.js](https://www.npmjs.com/package/extra-async-function),
33
🌐 [Web](https://www.npmjs.com/package/extra-async-function.web),
44
📜 [Files](https://unpkg.com/extra-async-function/),
55
📰 [JSDoc](https://nodef.github.io/extra-async-function/),
66
📘 [Wiki](https://github.com/nodef/extra-async-function/wiki/).
77

8-
An [async function] is a function that delivers its [result asynchronously]
9-
(through [Promise]). This package is an *variant* of [extra-function], and
10-
includes methods for transforming *async functions*. The **result** of an async
11-
function can be manipulated with [negate]. If a *pure* async function is
12-
expensive, its results can **cached** with [memoize]. **Parameters** of a
13-
function can be manipulated with [reverse], [spread], [unspread]. [reverse]
14-
flips the order of parameters, [spread] spreads the first array parameter of a
15-
function, and [unspread] combines all parameters into the first parameter
16-
(array). If you want some **functional behavior**, [compose], [composeRight],
17-
[curry], and [curryRight] can be used. [composeRight] is also known as
18-
[pipe-forward operator] or [function chaining]. If you are unfamiliar, [Haskell]
19-
is a great purely functional language, and there is great [haskell beginner
20-
guide] to learn from.
8+
This package is an *variant* of [extra-function], and includes methods for
9+
transforming *async functions*. The **result** of an async function can be
10+
manipulated with [negate]. If a *pure* async function is expensive, its results
11+
can **cached** with [memoize]. **Parameters** of a function can be manipulated
12+
with [reverse], [spread], [unspread]. [reverse] flips the order of parameters,
13+
[spread] spreads the first array parameter of a function, and [unspread]
14+
combines all parameters into the first parameter (array). If you want some
15+
**functional behavior**, [compose], [composeRight], [curry], and [curryRight]
16+
can be used. [composeRight] is also known as [pipe-forward operator] or
17+
[function chaining]. If you are unfamiliar, [Haskell] is a great purely
18+
functional language, and there is great [haskell beginner guide] to learn from.
2119

2220
To control invocation **time** of a function, use [delay]. A function can be
2321
**rate controlled** with [debounce], [debounceEarly], [throttle],
@@ -35,9 +33,9 @@ In addition, [is], [name], and [length] obtain metadata (about) information on
3533
an async function. To attach a `this` to a function, use [bind]. A few generic
3634
async functions are also included: [ARGUMENTS], [NOOP], [IDENTITY], [COMPARE].
3735

38-
This package is available in both *Node.js* and *Web* formats. The web format is
39-
exposed as `extra_async_function` standalone variable and can be loaded from
40-
[jsDelivr CDN].
36+
This package is available in *Node.js* and *Web* formats. To use it on the web,
37+
simply use the `extra_async_function` global variable after loading with a `<script>`
38+
tag from the [jsDelivr CDN].
4139

4240
[async function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
4341
[result asynchronously]: https://exploringjs.com/impatient-js/ch_async-functions.html#async-constructs
@@ -56,21 +54,21 @@ exposed as `extra_async_function` standalone variable and can be loaded from
5654

5755

5856
```javascript
59-
const asyncFunction = require('extra-async-function');
60-
// import * as asyncFunction from "extra-async-function";
61-
// import * as asyncFunction from "https://unpkg.com/extra-async-function/index.mjs"; (deno)
57+
const xasyncfn = require('extra-async-function');
58+
// import * as xasyncfn from "extra-async-function";
59+
// import * as xasyncfn from "https://unpkg.com/extra-async-function/index.mjs"; (deno)
6260

6361
// 1. Basic tests.
6462
async function example1() {
65-
var a = asyncFunction.composeRight(async x => x*x, async x => x+2);
63+
var a = xasyncfn.composeRight(async x => x*x, async x => x+2);
6664
await a(10);
6765
// → 102
6866

69-
var a = asyncFunction.curry(async (x, y) => x+y);
67+
var a = xasyncfn.curry(async (x, y) => x+y);
7068
await a(2)(3);
7169
// → 7
7270

73-
var a = asyncFunction.unspread(async (...xs) => Math.max(...xs));
71+
var a = xasyncfn.unspread(async (...xs) => Math.max(...xs));
7472
await a([2, 3, 1]);
7573
// → 1.25
7674
}

0 commit comments

Comments
 (0)