Skip to content

Commit 8d283dd

Browse files
committed
empty
1 parent b344268 commit 8d283dd

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

README.md

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ This is a fast polyfill for [`TextEncoder`][1] and [`TextDecoder`][2], which let
55
It is fast partially as it does not support^ any encodings aside UTF-8 (and note that natively, only `TextDecoder` supports alternative encodings anyway).
66
See [some benchmarks](https://github.com/samthor/fast-text-encoding/tree/master/bench).
77

8-
<small>
9-
108
^If this polyfill used on Node v5.1 through v11 (when `Text...` was introduced), then this simply wraps `Buffer`, which supports many encodings and is native code.
119

12-
</small>
13-
1410
[1]: https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder
1511
[2]: https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder
1612

@@ -22,7 +18,7 @@ You only need this polyfill if you're supporting older browsers like IE, legacy
2218

2319
## Browser
2420

25-
Include the minified code inside a `script` tag or as an ES6 Module for its side effects.
21+
Include the minified code inside a `<script>` tag or as an ES6 Module for its side effects.
2622
It will create `TextEncoder` and `TextDecoder` if the symbols are missing on `window` or `global.`
2723

2824
```html
@@ -34,31 +30,9 @@ It will create `TextEncoder` and `TextDecoder` if the symbols are missing on `wi
3430
</script>
3531
```
3632

37-
⚠️ You'll probably want to depend on `text.min.js`, as it's compiled to ES5 for older environments.
38-
39-
## Node
40-
41-
You only need this polyfill in Node before v11.
42-
However, you can use `Buffer` to provide the same functionality (but not conforming to any spec) in versions even older than that.
43-
44-
```js
45-
require('fast-text-encoding'); // just require me before use
46-
47-
const buffer = new TextEncoder().encode('Turn me into UTF-8!');
48-
// buffer is now a Uint8Array of [84, 117, 114, 110, ...]
49-
```
50-
51-
In Node v5.1 and above, this polyfill uses `Buffer` to implement `TextDecoder`.
52-
53-
# Release
33+
⚠️ You'll probably want to depend on "text.min.js", as it's compiled to ES5 for older environments.
5434

55-
Compile code with [Closure Compiler](https://closure-compiler.appspot.com/home).
35+
## Not Including Polyfill
5636

57-
```
58-
// ==ClosureCompiler==
59-
// @compilation_level ADVANCED_OPTIMIZATIONS
60-
// @output_file_name text.min.js
61-
// ==/ClosureCompiler==
62-
63-
// code here
64-
```
37+
If your project doesn't need the polyfill, but is included as a transitive dependency, we publish [an empty version](https://www.npmjs.com/package/fast-text-encoding/v/0.0.0-empty) that you could pin NPM or similar's version algorithm to.
38+
Use "fast-text-encoding@empty".

0 commit comments

Comments
 (0)