Skip to content

Commit

Permalink
📚 docs(manual): Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Oct 16, 2022
1 parent faff980 commit a8f3530
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
4 changes: 3 additions & 1 deletion doc/manual/example.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Example
# Examples

> More examples in [the test files](https://github.com/codec-bytes/base16/tree/main/test/src).
15 changes: 11 additions & 4 deletions doc/manual/installation.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Installation

Can be managed using
[jspm](http://jspm.io)
or [npm](https://github.com/npm/npm).
[yarn](https://yarnpkg.com/en/docs),
[npm](https://docs.npmjs.com),
or [jspm](https://jspm.org/docs).

### jspm

### yarn
```terminal
jspm install npm:@codec-bytes/base16
yarn add @codec-bytes/base16
```

### npm
```terminal
npm install @codec-bytes/base16 --save
```

### jspm
```terminal
jspm install npm:@codec-bytes/base16
```
17 changes: 10 additions & 7 deletions doc/manual/usage.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Usage

The code needs a ES2015+ polyfill to work, for example
[regenerator-runtime/runtime](https://babeljs.io/docs/usage/polyfill).
> :warning: Depending on your environment, the code may require
> `regeneratorRuntime` to be defined, for instance by importing
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
First, require the polyfill at the entry point of your application
```js
await import( 'regenerator-runtime/runtime.js' ) ;
await import('regenerator-runtime/runtime.js');
// or
import 'regenerator-runtime/runtime.js' ;
import 'regenerator-runtime/runtime.js';
```

Then
Then, import the library where needed
```js
const codecbase16 = await import( '@codec-bytes/base16' ) ;
const {encode, decode} = await import('@codec-bytes/base16');
// or
import * as codecbase16 from '@codec-bytes/base16' ;
import {encode, decode} from '@codec-bytes/base16';
```

0 comments on commit a8f3530

Please sign in to comment.