From ae7f9983922df3749e99da6e816b1f4cacf1f9bf Mon Sep 17 00:00:00 2001 From: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> Date: Wed, 29 Apr 2026 15:57:59 +0100 Subject: [PATCH] Update for v12 --- Node-API.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Node-API.md b/Node-API.md index d6e434f..2c73fee 100644 --- a/Node-API.md +++ b/Node-API.md @@ -346,38 +346,38 @@ chef.help("toBase32") // OK If there is more than one match for the given search term, `help` will return multiple matches. It searches in the operation name and the description field, prioritising matches in the operation name. #### `bake` -`bake` is useful for building "recipes" - chains of operations to apply to some input, in order. `bake` accepts operations in multiple ways. It always returns a `Dish` object. +`bake` is useful for building "recipes" - chains of operations to apply to some input, in order. `bake` accepts operations in multiple ways. It always returns a `Dish` object. `bake` is async, so should normally be called inside an `await` call. One operation, no arguments ```javascript -chef.bake("I'll have the cod.", chef.toBase64); +await(chef.bake("I'll have the cod.", chef.toBase64)); // => SSdsbCBoYXZlIHRoZSBjb2Qu ``` One operation by name ```javascript -chef.bake("I'll have the cod.", "to base 64"); +await(chef.bake("I'll have the cod.", "to base 64")); // => SSdsbCBoYXZlIHRoZSBjb2Qu ``` Multiple operations, by name or by function (default arguments) ```javascript -chef.bake("I'll have the cod", [chef.toBase64, "sha1"]); +await(chef.bake("I'll have the cod", [chef.toBase64, "sha1"])); // => f20135964d60f5fb66f971f5ee33d8395d1f90bf ``` One operation, with custom arguments ```javascript -chef.bake("I'll have the salmon.", { +await(chef.bake("I'll have the salmon.", { op: chef.toBase64, args: { alphabet: "A-Z", }, -}); +})); // => SSCBYXZIHRZSBYW ``` Multiple operations with custom arguments ```javascript -chef.bake("I'll have the salmon.", [ +await(chef.bake("I'll have the salmon.", [ { op: chef.toBase64, args: { @@ -391,7 +391,7 @@ chef.bake("I'll have the salmon.", [ reverse: true, } } -]); +])); // => ZZYYXWSSSRIHCBB ``` @@ -407,7 +407,7 @@ const recipe = [ "args": ["Nothing (separate chars)", true, "Alphabetical (case sensitive)"] } ]; -chef.bake("I'll have the salmon.", recipe); +await(chef.bake("I'll have the salmon.", recipe)); // => ZZYYXWSSSRIHCBB ``` @@ -576,24 +576,24 @@ Useful for consuming recipes saved from the web version of CyberChef. #### Examples: ```javascript // Single operation input -chef.bake("Apple pie", chef.toBase32).toString(); +await(chef.bake("Apple pie", chef.toBase32)).toString(); // => IFYHA3DFEBYGSZI= // Single operation name -chef.bake("Apple pie", "to base 32").toString(); +await(chef.bake("Apple pie", "to base 32")).toString(); // => IFYHA3DFEBYGSZI= // Single operation object with args -chef.bake("Apple pie", { +await(chef.bake("Apple pie", { op: chef.toBase32, // string would work here too args: { alphabet: "A-Z" } -}).toString(); +})).toString(); // => IFYHADFEBYGSZI // Multiple operations -chef.bake("Apple pie", [ +await(chef.bake("Apple pie", [ chef.toBase32, { op: "from base 32", @@ -601,7 +601,7 @@ chef.bake("Apple pie", [ alphabet: "A-Z2-7=", }, } -]).toString(); +])).toString(); // => Apple pie ```