From 227d7d28fd3d8021e58bde88158491cdac713921 Mon Sep 17 00:00:00 2001 From: Sam Thorogood Date: Mon, 4 Sep 2017 11:54:51 +1000 Subject: [PATCH] nodeJS buffer note --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f9fd3a..863c38f 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,9 @@ const buffer = new TextEncoder().encode('Turn me into UTF-8!'); // buffer is now a Uint8Array of [84, 117, 114, 110, ...] ``` +However, note that `Buffer.from('Turn me into UTF-8!')` is Node's native version of the text encoding functionality. +You can probably massage [`Buffer`](https://nodejs.org/api/buffer.html) into acting like `TextEncoder` and `TextDecoder`. + # Supports Built for IE11, Edge and Node environments. @@ -48,4 +51,4 @@ Compile code with [Closure Compiler](https://closure-compiler.appspot.com/home). // ==/ClosureCompiler== // code here -``` \ No newline at end of file +```