add named exports to wiki
parent
50dc2317fa
commit
aef76aeeed
31
Node-API.md
31
Node-API.md
@ -43,9 +43,9 @@ const aestTime = chef.translateDateTimeFormat("15/06/2015 20:45:00", {
|
||||
|
||||
### Parse a Teredo IPv6 Address
|
||||
```javascript
|
||||
import { parseIPv6Address } from "cyberchef";
|
||||
import chef from "cyberchef";
|
||||
|
||||
console.log(parseIPv6Address("2001:0000:4136:e378:8000:63bf:3fff:fdd2"));
|
||||
console.log(chef.parseIPv6Address("2001:0000:4136:e378:8000:63bf:3fff:fdd2"));
|
||||
/** =>
|
||||
Longhand: 2001:0000:4136:e378:8000:63bf:3fff:fdd2
|
||||
Shorthand: 2001:0:4136:e378:8000:63bf:3fff:fdd2
|
||||
@ -69,29 +69,29 @@ Teredo prefix range: 2001::/32 */
|
||||
|
||||
### Convert data from a Hexdump, then decompress
|
||||
```javascript
|
||||
import { Dish, fromHexdump, gunzip } from "cyberchef";
|
||||
import chef from "cyberchef";
|
||||
|
||||
const message = new Dish(`00000000 1f 8b 08 00 12 bc f3 57 00 ff 0d c7 c1 09 00 20 |.....¼óW.ÿ.ÇÁ.. |
|
||||
const message = new chef.Dish(`00000000 1f 8b 08 00 12 bc f3 57 00 ff 0d c7 c1 09 00 20 |.....¼óW.ÿ.ÇÁ.. |
|
||||
00000010 08 05 d0 55 fe 04 2d d3 04 1f ca 8c 44 21 5b ff |..ÐUþ.-Ó..Ê.D
|
||||
|
||||
##### `File` output type from Dish
|
||||
Node.js does not have a `File` API, so for operations that return a `File`, we use a shim which creates an object with the same shape as the `File` Web API. You can access the underlying data if this file type with `file.data`, which will be an `ArrayBuffer`.
|
||||
|
||||
#### Compose operations
|
||||
Operations can be composed using `apply`. This example performs ROT13 substitution followed by conversion to Hex on some input:
|
||||
```javascript
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user