aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-108/stuart-little/node/ch-1.js11
-rwxr-xr-xchallenge-108/stuart-little/node/ch-2.js5
2 files changed, 16 insertions, 0 deletions
diff --git a/challenge-108/stuart-little/node/ch-1.js b/challenge-108/stuart-little/node/ch-1.js
new file mode 100755
index 0000000000..baf649dc71
--- /dev/null
+++ b/challenge-108/stuart-little/node/ch-1.js
@@ -0,0 +1,11 @@
+#!/usr/bin/env node
+
+// run <script>
+// ref: https://github.com/node-ffi-napi/ref-napi
+
+let ref = require('ref-napi');
+let buf = Buffer.alloc(8);
+buf.writeInt32LE(5, 0);
+
+buf.type = ref.types.int;
+console.log(`The buffer buf holds the value ${buf.deref()} and its memory location is ${parseInt(buf.hexAddress(), 16)}.`);
diff --git a/challenge-108/stuart-little/node/ch-2.js b/challenge-108/stuart-little/node/ch-2.js
new file mode 100755
index 0000000000..950892dd96
--- /dev/null
+++ b/challenge-108/stuart-little/node/ch-2.js
@@ -0,0 +1,5 @@
+#!/usr/bin/env node
+
+// run <script>
+
+console.log("1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147");