File tree Expand file tree Collapse file tree 3 files changed +24
-12
lines changed
Expand file tree Collapse file tree 3 files changed +24
-12
lines changed 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/codec-bytes/base32/tree/main/test/src ) .
Original file line number Diff line number Diff line change 11# Installation
22
33Can 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 ) .
67
7- ### jspm
8+
9+ ### yarn
810``` terminal
9- jspm install npm: @codec-bytes/base32
11+ yarn add @codec-bytes/base32
1012```
1113
1214### npm
1315``` terminal
1416npm install @codec-bytes/base32 --save
1517```
18+
19+ ### jspm
20+ ``` terminal
21+ jspm install npm:@codec-bytes/base32
22+ ```
Original file line number Diff line number Diff line change 11# Usage
22
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
58``` js
6- await import ( ' regenerator-runtime/runtime.js' ) ;
9+ await import (' regenerator-runtime/runtime.js' ) ;
710// or
8- import ' regenerator-runtime/runtime.js' ;
11+ import ' regenerator-runtime/runtime.js' ;
912```
1013
11- Then
14+ Then, import the library where needed
1215``` js
13- const codecbase32 = await import ( ' @codec-bytes/base32' ) ;
16+ const { encode , decode } = await import (' @codec-bytes/base32' ) ;
1417// or
15- import * as codecbase32 from ' @codec-bytes/base32' ;
18+ import { encode , decode } from ' @codec-bytes/base32' ;
1619```
You can’t perform that action at this time.
0 commit comments