diff --git a/doc/manual/example.md b/doc/manual/example.md index b4f04f4..56c0ca7 100644 --- a/doc/manual/example.md +++ b/doc/manual/example.md @@ -1 +1,3 @@ -# Example +# Examples + +> More examples in [the test files](https://github.com/codec-bytes/base32/tree/main/test/src). diff --git a/doc/manual/installation.md b/doc/manual/installation.md index ca886ea..3213283 100644 --- a/doc/manual/installation.md +++ b/doc/manual/installation.md @@ -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/base32 +yarn add @codec-bytes/base32 ``` ### npm ```terminal npm install @codec-bytes/base32 --save ``` + +### jspm +```terminal +jspm install npm:@codec-bytes/base32 +``` diff --git a/doc/manual/usage.md b/doc/manual/usage.md index 0c27135..f23978c 100644 --- a/doc/manual/usage.md +++ b/doc/manual/usage.md @@ -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 codecbase32 = await import( '@codec-bytes/base32' ) ; +const {encode, decode} = await import('@codec-bytes/base32'); // or -import * as codecbase32 from '@codec-bytes/base32' ; +import {encode, decode} from '@codec-bytes/base32'; ```