From 30340388f10001557e8c9a6f158c640565f733cc 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 51a59d91bdc011..016aa4ed8cb3bb 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: '?'