We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a3cf9c commit 2f75c82Copy full SHA for 2f75c82
1 file changed
README.md
@@ -11,6 +11,8 @@ Quick check if a Node.js Buffer or Uint8Array is UTF-8.
11
`npm install isutf8`
12
13
## Usage
14
+
15
+### commonjs
16
```js
17
'use strict';
18
@@ -26,5 +28,18 @@ console.log(isUtf8(arr)); // => true
26
28
27
29
```
30
31
+### ES Modules or TypeScript
32
+```js
33
+import isUtf8 from 'isutf8';
34
35
+const buf = Buffer.from([0xd0, 0x90]);
36
+console.log(isUtf8(buf)); // => true
37
38
+// or
39
40
+const arr = new Uint8Array([0xd0, 0x90]);
41
+console.log(isUtf8(arr)); // => true
42
+```
43
44
## License
45
[MIT License](./LICENSE)
0 commit comments