From 39ed512d8a9c7c3f2e5a63155fb4ab282f6497b5 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sat, 26 Nov 2016 23:15:11 +0200 Subject: [PATCH] doc: add a variable declaration in the buffer.md PR-URL: https://github.com/nodejs/node/pull/9795 Reviewed-By: Sam Roberts Reviewed-By: Roman Reiss Reviewed-By: Anna Henningsen --- doc/api/buffer.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index ae0182aea5..d7e29966bc 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -2328,6 +2328,8 @@ The transcoding process will use substitution characters if a given byte sequence cannot be adequately represented in the target encoding. For instance: ```js +const buffer = require('buffer'); + const newBuf = buffer.transcode(Buffer.from('€'), 'utf8', 'ascii'); console.log(newBuf.toString('ascii')); // Prints: '?'