Skip to content

Commit

Permalink
doc: add a variable declaration in the buffer.md
Browse files Browse the repository at this point in the history
PR-URL: #9795
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
vsemozhetbyt authored and Fishrock123 committed Dec 13, 2016
1 parent 778e5f7 commit 3034038
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: '?'
Expand Down

0 comments on commit 3034038

Please sign in to comment.