From e556dd3856d42ae8e94e27846b8cf7c1dfff05d3 Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Mon, 25 Apr 2016 10:36:57 +0800 Subject: doc: use Buffer.from() instead of new Buffer() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use new API of Buffer to developers in most documents. PR-URL: https://github.com/nodejs/node/pull/6367 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Сковорода Никита Андреевич --- doc/api/string_decoder.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/api/string_decoder.md') diff --git a/doc/api/string_decoder.md b/doc/api/string_decoder.md index d1de27dc4a..f979e7dd37 100644 --- a/doc/api/string_decoder.md +++ b/doc/api/string_decoder.md @@ -10,10 +10,10 @@ additional support for utf8. const StringDecoder = require('string_decoder').StringDecoder; const decoder = new StringDecoder('utf8'); -const cent = new Buffer([0xC2, 0xA2]); +const cent = Buffer.from([0xC2, 0xA2]); console.log(decoder.write(cent)); -const euro = new Buffer([0xE2, 0x82, 0xAC]); +const euro = Buffer.from([0xE2, 0x82, 0xAC]); console.log(decoder.write(euro)); ``` -- cgit v1.2.3