File tree 5 files changed +30
-14
lines changed 5 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,13 @@ User:Watchduck
13
13
</p >
14
14
15
15
Permutation library for JavaScript.
16
- See [ docs] ( https://computational-combinatorics.github.io/permutation ) .
16
+ See [ docs] ( https://computational-combinatorics.github.io/permutation/index.html ) .
17
17
Parent is [ js-algorithms] ( https://github.com/make-github-pseudonymous-again/js-algorithms ) .
18
18
19
+ > :warning : Depending on your environment, the code may require
20
+ > ` regeneratorRuntime ` to be defined, for instance by importing
21
+ > [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
22
+
19
23
``` js
20
24
import { next , reversed , identity } from ' @combinatorics/permutation' ;
21
25
next ( reversed ( identity ( 3 ) ) ) ; // [ 0 , 1 , 2 ]
Original file line number Diff line number Diff line change 1
- # Example
1
+ # Examples
2
+
3
+ > More examples in [ the test files] ( https://github.com/computational-combinatorics/permutation/tree/main/test/src ) .
2
4
3
5
``` js
4
6
import {
Original file line number Diff line number Diff line change 1
1
# Installation
2
2
3
3
Can be managed using
4
- [ jspm] ( http://jspm.io )
5
- or [ npm] ( https://github.com/npm/npm ) .
4
+ [ yarn] ( https://yarnpkg.com/en/docs ) ,
5
+ [ npm] ( https://docs.npmjs.com ) ,
6
+ or [ jspm] ( https://jspm.org/docs ) .
6
7
7
- ### jspm
8
+
9
+ ### yarn
8
10
``` terminal
9
- jspm install npm: @combinatorics/permutation
11
+ yarn add @combinatorics/permutation
10
12
```
11
13
12
14
### npm
13
15
``` terminal
14
16
npm install @combinatorics/permutation --save
15
17
```
18
+
19
+ ### jspm
20
+ ``` terminal
21
+ jspm install npm:@combinatorics/permutation
22
+ ```
Original file line number Diff line number Diff line change 1
1
# Usage
2
2
3
- The code needs a ES2015+ polyfill to work, for example
4
- [ regenerator-runtime/runtime] ( https://babeljs.io/docs/usage/polyfill ) .
3
+ > :warning : Depending on your environment, the code may require
4
+ > ` regeneratorRuntime ` to be defined, for instance by importing
5
+ > [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
6
+
7
+ First, require the polyfill at the entry point of your application
5
8
``` js
6
- await import ( ' regenerator-runtime/runtime.js' ) ;
9
+ await import (' regenerator-runtime/runtime.js' ) ;
7
10
// or
8
- import ' regenerator-runtime/runtime.js' ;
11
+ import ' regenerator-runtime/runtime.js' ;
9
12
```
10
13
11
- Then
14
+ Then, import the library where needed
12
15
``` js
13
- const permutation = await import ( ' @combinatorics/permutation' ) ;
16
+ const permutation = await import (' @combinatorics/permutation' ) ;
14
17
// or
15
- import * as permutation from ' @combinatorics/permutation' ;
18
+ import * as permutation from ' @combinatorics/permutation' ;
16
19
```
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const domReady = function (callback) {
10
10
domReady ( ( ) => {
11
11
const projectname = document . createElement ( 'a' ) ;
12
12
projectname . classList . add ( 'project-name' ) ;
13
- projectname . text = 'combinatorics/permutation' ;
13
+ projectname . text = '@ combinatorics/permutation' ;
14
14
projectname . href = './index.html' ;
15
15
16
16
const header = document . querySelector ( 'header' ) ;
You can’t perform that action at this time.
0 commit comments