From aa29de0aa56014be767f830798e50b812eaf847b 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 ae0182aea5646b..d7e29966bcab1d 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: '?'