@@ -25,7 +25,7 @@ Compare two `Uint8Arrays`
25
25
#### Example
26
26
27
27
``` js
28
- const compare = require ( ' uint8arrays/compare' )
28
+ import { compare } from ' uint8arrays/compare'
29
29
30
30
const arrays = [
31
31
Uint8Array .from ([3 , 4 , 5 ]),
@@ -50,7 +50,7 @@ If you know the length of the arrays, pass it as a second parameter, otherwise i
50
50
#### Example
51
51
52
52
``` js
53
- const concat = require ( ' uint8arrays/concat' )
53
+ import { concat } from ' uint8arrays/concat'
54
54
55
55
const arrays = [
56
56
Uint8Array .from ([0 , 1 , 2 ]),
@@ -70,7 +70,7 @@ Returns true if the two arrays are the same array or if they have the same lengt
70
70
#### Example
71
71
72
72
``` js
73
- const equals = require ( ' uint8arrays/equals' )
73
+ import { equals } from ' uint8arrays/equals'
74
74
75
75
const a = Uint8Array .from ([0 , 1 , 2 ])
76
76
const b = Uint8Array .from ([3 , 4 , 5 ])
@@ -90,7 +90,7 @@ Supports `utf8` and any of the [multibase encodings](https://github.com/multifor
90
90
#### Example
91
91
92
92
``` js
93
- const fromString = require ( ' uint8arrays/from-string' )
93
+ import { fromString } from ' uint8arrays/from-string'
94
94
95
95
console .info (fromString (' hello world' )) // Uint8Array[104, 101 ...
96
96
console .info (fromString (' 00010203aabbcc' , ' base16' )) // Uint8Array[0, 1 ...
@@ -107,7 +107,7 @@ Supports `utf8` and any of the [multibase encodings](https://github.com/multifor
107
107
#### Example
108
108
109
109
``` js
110
- const toString = require ( ' uint8arrays/to-string' )
110
+ import { toString } from ' uint8arrays/to-string'
111
111
112
112
console .info (toString (Uint8Array .from ([104 , 101. ..]))) // 'hello world'
113
113
console .info (toString (Uint8Array .from ([0 , 1 , 2. ..]), ' base16' )) // '00010203aabbcc'
@@ -122,7 +122,7 @@ Returns a `Uint8Array` containing `a` and `b` xored together.
122
122
#### Example
123
123
124
124
``` js
125
- const xor = require ( ' uint8arrays/xor' )
125
+ import { xor } from ' uint8arrays/xor'
126
126
127
127
console .info (xor (Uint8Array .from ([1 , 0 ]), Uint8Array .from ([0 , 1 ]))) // Uint8Array[1, 1]
128
128
```
0 commit comments