Skip to content

Commit

Permalink
πŸ› docs: update require name
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfram77 committed Apr 12, 2023
1 parent e1fff67 commit 0c5fc02
Show file tree
Hide file tree
Showing 6 changed files with 715 additions and 3,963 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
tags:
- '!*' # Do not execute on tags
env:
NAME: ${{vars.NAME}}
EMAIL: ${{vars.EMAIL}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
FORCE_COLOR: 1
Expand Down Expand Up @@ -55,8 +58,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 18.x
- run: git clone https://${GITHUB_TOKEN}@github.com/nodef/deploy "$HOME/deploy"
- run: bash "$HOME/deploy/setup.sh"
- uses: nodef/[email protected]
- run: npm i -g typescript typedoc
- run: npm ci
- run: npm run publish-docs
Expand All @@ -71,8 +73,9 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 18.x
- run: git clone https://${GITHUB_TOKEN}@github.com/nodef/deploy "$HOME/deploy"
- run: bash "$HOME/deploy/setup.sh"
- uses: nodef/[email protected]
with:
entries: access = public
- run: npm i -g typescript rollup typedoc browserify terser
- run: npm ci
- run: npm run publish-packages
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
A collection of functions for operating upon iterables.<br>
An [iterable] is a sequence of values.<br>
πŸ“¦ [Node.js](https://www.npmjs.com/package/extra-iterable),
🌐 [Web](https://www.npmjs.com/package/extra-iterable.web),
πŸ“œ [Files](https://unpkg.com/extra-iterable/),
πŸ“° [Docs](https://nodef.github.io/extra-iterable/),
πŸ“˜ [Wiki](https://github.com/nodef/extra-iterable/wiki/).

An [iterable] is a sequence of values. Assumption here is that an iterable can
only be iterated over once. Methods which require multiple iterations preserve
old values in a backup array using [toMany]. Many methods accept both compare
and map functions, and in some cases using **only** a map function enables
*faster comparision* (like [unique]). I borrowed a lot of ideas from Haskell,
Elm, Python, Basic, Lodash, and other NPM packages. These are mentioned in
references of each method.
This is a collection of functions for operating upon **iterables**. Assumption
here is that an **iterable** can *only* be iterated over *once*. Methods which
require multiple iterations preserve old values in a backup array using
[toMany]. Many methods accept both compare and map functions, and in some cases
using **only** a map function enables *faster comparision* (like [unique]). I
borrowed a lot of ideas from Haskell, Elm, Python, Basic, Lodash, and other NPM
packages. These are mentioned in references of each method.

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

> Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).
Expand All @@ -25,24 +25,24 @@ is exposed as `extra_iterable` standalone variable and can be loaded from
<br>

```javascript
const iterable = require('extra-iterable');
// import * as iterable from "extra-iterable";
// import * as iterable from "https://unpkg.com/extra-iterable/index.mjs"; (deno)
const xiterable = require('extra-iterable');
// import * as xiterable from "extra-iterable";
// import * as xiterable from "https://unpkg.com/extra-iterable/index.mjs"; (deno)

var x = [2, 4, 6, 8];
iterable.get(x, 1);
xiterable.get(x, 1);
// β†’ 4

var x = [1, 2, 3, 4];
[...iterable.swap(x, 0, 1)];
[...xiterable.swap(x, 0, 1)];
// β†’ [ 2, 1, 3, 4 ]

var x = [1, 2, 3];
[...iterable.cycle(x, 0, 4)];
[...xiterable.cycle(x, 0, 4)];
// β†’ [1, 2, 3, 1]

var x = [1, 2, 3, 4];
iterable.reduce(x, (acc, v) => acc+v);
xiterable.reduce(x, (acc, v) => acc+v);
// β†’ 10
```

Expand Down
Loading

0 comments on commit 0c5fc02

Please sign in to comment.