diff options
| author | chirvasitua <stuart-little@users.noreply.github.com> | 2021-04-12 17:44:06 -0400 |
|---|---|---|
| committer | chirvasitua <stuart-little@users.noreply.github.com> | 2021-04-12 17:44:06 -0400 |
| commit | db14afe86bb3bf385cd725b216ae5a68f5812c69 (patch) | |
| tree | d16156fed5da344b64b841f98e7cf1cb23e08d9b | |
| parent | eeb4cf0caad65ceee5fdddb161be04383ad53428 (diff) | |
| download | perlweeklychallenge-club-db14afe86bb3bf385cd725b216ae5a68f5812c69.tar.gz perlweeklychallenge-club-db14afe86bb3bf385cd725b216ae5a68f5812c69.tar.bz2 perlweeklychallenge-club-db14afe86bb3bf385cd725b216ae5a68f5812c69.zip | |
1st commit on 108_node
| -rwxr-xr-x | challenge-108/stuart-little/node/ch-1.js | 11 | ||||
| -rwxr-xr-x | challenge-108/stuart-little/node/ch-2.js | 5 |
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"); |
