Minor changes
parent
3a22285d2d
commit
6978d32f0d
12
Node-API.md
12
Node-API.md
@ -79,6 +79,18 @@ const message = new Dish(`00000000 1f 8b 08 00 12 bc f3 57 00 ff 0d c7 c1 09 00
|
|||||||
message.toString() === "So long and thanks for all the fish." //true
|
message.toString() === "So long and thanks for all the fish." //true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Interact with files from Node.js `fs` library
|
||||||
|
```javascript
|
||||||
|
import { Dish, toHex } from "CyberChef";
|
||||||
|
|
||||||
|
fs.writeFileSync("test.txt", toHex("hello"));
|
||||||
|
|
||||||
|
const file = new Dish(fs.readFileSync("test.txt"));
|
||||||
|
|
||||||
|
console.log(file) // 68 65 6c 6c 6f
|
||||||
|
file.fromHex().toString() === "hello"; // true
|
||||||
|
```
|
||||||
|
|
||||||
## Import with ES6 `import` or CommonJS `require`
|
## Import with ES6 `import` or CommonJS `require`
|
||||||
|
|
||||||
#### ES6 imports
|
#### ES6 imports
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user