Skip to content

Commit

Permalink
better instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
samthor committed Sep 1, 2017
1 parent 0583c80 commit b8b7bdb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@ It will create `TextEncoder` and `TextDecoder` if the symbols are missing on `wi
<script src="node_modules/fast-text-encoding/text.min.js"></script>
<script type="module">
import './node_modules/fast-text-encoding/text.min.js';
// do something with TextEncoder
// confidently do something with TextEncoder \o/
</script>
```

**Note**: Always include `text.min.js`, as it's compiled to ES5 for older environments.

## Node

Install via NPM or Yarn:

```bash
yarn add fast-text-encoding
```

And then import purely for side effects:
Install via NPM or Yarn (name "fast-text-encoding"), and then import purely for side effects:

```js
// don't need to save this anywhere, just require before use
require('fast-text-encoding');

const buffer = new TextEncoder().encode('Turn me into UTF-8!');
// buffer is now a Uint8Array of [84, 117, 114, 110, ...]
```

# Supports
Expand Down

0 comments on commit b8b7bdb

Please sign in to comment.