Skip to content
Permalink
Browse files

doc: add example for Buffer.isEncoding()

PR-URL: #28360
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
Meyito authored and targos committed Jun 21, 2019
1 parent 818f084 commit 4762399aca10d299d1e55537e3a3ceba3dee539b
Showing with 14 additions and 0 deletions.
  1. +14 −0 doc/api/buffer.md
@@ -951,6 +951,20 @@ added: v0.9.1
Returns `true` if `encoding` contains a supported character encoding, or `false`
otherwise.

```js
console.log(Buffer.isEncoding('utf-8'));
// Prints: true
console.log(Buffer.isEncoding('hex'));
// Prints: true
console.log(Buffer.isEncoding('utf/8'));
// Prints: false
console.log(Buffer.isEncoding(''));
// Prints: false
```

### Class Property: Buffer.poolSize
<!-- YAML
added: v0.11.3

0 comments on commit 4762399

Please sign in to comment.
You can’t perform that action at this time.