{"id":19343299,"url":"https://github.com/obusk/walkable-buffer","last_synced_at":"2026-02-21T21:07:46.012Z","repository":{"id":32661022,"uuid":"139065924","full_name":"oBusk/walkable-buffer","owner":"oBusk","description":"🚶🛡️ A class for easily reading data from binary Buffers","archived":false,"fork":false,"pushed_at":"2024-07-23T11:35:48.000Z","size":1558,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-03T21:17:29.020Z","etag":null,"topics":["binary","binary-buffers","buffer","node"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oBusk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-28T20:37:08.000Z","updated_at":"2024-04-30T17:53:32.000Z","dependencies_parsed_at":"2023-01-14T21:51:45.954Z","dependency_job_id":null,"html_url":"https://github.com/oBusk/walkable-buffer","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/oBusk/walkable-buffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fwalkable-buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fwalkable-buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fwalkable-buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fwalkable-buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oBusk","download_url":"https://codeload.github.com/oBusk/walkable-buffer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oBusk%2Fwalkable-buffer/sbom","scorecard":{"id":700379,"data":{"date":"2025-08-11","repo":{"name":"github.com/oBusk/walkable-buffer","commit":"9be87e7b6c07caeb37354ecac31e9f1098ed55b5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:95: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:97: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:102: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:112: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:129: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:131: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:136: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:143: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:166: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:168: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:172: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:179: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/nodejs.yml:195: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/nodejs.yml:82: update your workflow using https://app.stepsecurity.io/secureworkflow/oBusk/walkable-buffer/nodejs.yml/main?enable=pin","Info:   0 out of  21 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Info: FSF or OSI recognized license: MIT License: LICENCE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T05:05:21.000Z","repository_id":32661022,"created_at":"2025-08-22T05:05:21.000Z","updated_at":"2025-08-22T05:05:21.000Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280930422,"owners_count":26415536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary","binary-buffers","buffer","node"],"created_at":"2024-11-10T03:37:56.630Z","updated_at":"2025-10-25T09:08:15.720Z","avatar_url":"https://github.com/oBusk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Walkable Buffer\n\n[![NPM Version](https://img.shields.io/npm/v/walkable-buffer)](https://www.npmjs.com/package/walkable-buffer)\n[![Node.js CI](https://github.com/oBusk/walkable-buffer/workflows/Node.js%20CI/badge.svg)](https://github.com/oBusk/walkable-buffer/actions?query=workflow%3A%22Node.js+CI%22)\n[![CodeQL](https://github.com/oBusk/walkable-buffer/workflows/CodeQL/badge.svg)](https://github.com/oBusk/walkable-buffer/actions?query=workflow%3ACodeQL)\n[![Dependabot: enabled](https://badgen.net/badge/dependabot/enabled/green?icon=dependabot)](https://github.com/oBusk/walkable-buffer/network/updates)\n[![codecov](https://codecov.io/gh/oBusk/walkable-buffer/branch/master/graph/badge.svg)](https://codecov.io/gh/oBusk/walkable-buffer)\n[![Bundlesize](https://img.shields.io/bundlephobia/minzip/walkable-buffer)](https://bundlephobia.com/result?p=walkable-buffer)\n[![Bundle Watched](https://img.shields.io/badge/bundle-watched-blue.svg)](https://bundlewatch.io)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n\u003e 🚶🛡️ A class for easily reading data from binary Buffers\n\n## Install\n\n```bash\nnpm install walkable-buffer\n```\n\n-   [Supported Node versions](./package.json#L20) aim to be\n    [Latest current and LTS](https://nodejs.org/en/download/releases/) as well as trying to keep up to date\n    with the latest supported node in\n    [Google cloud functions](https://cloud.google.com/functions/docs/concepts/nodejs-runtime).\n\n## Usage\n\n-   [Instance defaults](#instance-defaults)\n    -   [Defaults in Constructor](#defaults-in-constructor)\n    -   [Set/get defaults on existing instance](#setget-defaults-on-existing-instance)\n-   [Cursor](#cursor)\n    -   [`initialCursor` in constructor](#initialcursor-in-constructor)\n    -   [Manipulage Cursor](#manipulate-cursor)\n-   [Read Integers](#read-integers)\n-   [Read Strings](#read-strings)\n-   [Buffer](#buffer)\n-   [Size](#size)\n\n```js\nimport fs from \"fs\";\nimport WalkableBuffer from \"walkable-buffer\";\n\nconst buffer = fs.readFileSync(\"./temp\");\nconst wb = new WalkableBuffer({\n    buffer,\n    // Set instance defaults for `endianness`, `encoding` and `signed`\n    // The instance default can be overridden for each operation\n    endianness: \"LE\",\n    encoding: \"utf8\",\n    signed: true,\n});\n\nconst v = wb.get(\n    6 /* byteLength */,\n    \"BE\" /* endianness - Override instance default for this operation */,\n); // =\u003e 140 737 488 355 327\n\nconst s = wb.getString(\n    16 /* byteLength */,\n    \"utf16le\" /* encoding - overrides instance default */,\n); // =\u003e \"Hellö höw åre yö\"\n\nconst b = wb.getBigInt(\n    null /* endianness - null/undefined to use instance default */,\n    false /* signed - override isntance default */,\n); // 18_446_744_073_709_551_615n\n```\n\n### Instance defaults\n\nThe instance defaults include `endianness`, `encoding` and `signed` controlling how to read the binary\ndata into integers and text.\n\nThe effect of this is that the operations `get`/`peek` - `BigInt`/`String`/`SizedString` will use the\nconfigured settings if none is provided.\n\n|    Config    |      Default Value       |\n| :----------: | :----------------------: |\n| `endianness` |          `\"LE\"`          |\n|  `encoding`  |         `\"utf8\"`         |\n|   `signed`   | `true` (Signed integers) |\n\n#### Defaults in Constructor\n\nYou can set the instance defaults when creating the instance by configuring it in the\n[`WalkableBufferOptions`](src/WalkableBufferOptions.ts) provided to the constructor.\n\n```js\nimport WalkableBuffer from \"walkable-buffer\";\n\nconst wb = new WalkableBuffer({\n    buffer,\n    endianness: \"LE\",\n    encoding: \"utf8\",\n    signed: true,\n});\n```\n\n#### Set/get defaults on existing instance\n\nYou can also use `set`/`get` - `Endianness`/`Encoding`/`Signed`.\n\n```js\nimport WalkableBuffer from \"walkable-buffer\";\n\nconst wb = new WalkableBuffer({ buffer });\n\nwb.getEndianness(); // =\u003e \"LE\" (the default)\nwb.setEndianness(\"BE\");\nwb.getEndianness(); // =\u003e \"BE\"\n\nwb.getEncoding(); // \"utf8\" (the default)\nwb.setEncoding(\"ascii\");\nwb.getEncoding(); // =\u003e \"ascii\"\n\nwb.getSigned(); // true (for signed integers, the default)\nwb.setSigned(false);\nwb.getSigned(); // false (for unsigned integers)\n```\n\n### Cursor\n\nThe \"cursor\" is the byteOffset that the walkable buffer has currently \"walked\". It is the default\nposition to read data from, and it advances whenever a `get` operation is completed successfully.\n\nBy default, the WalkableBuffer will start with the cursor at `0`.\n\n#### `initialCursor` in constructor\n\n```js\nimport WalkableBuffer from \"walkable-buffer\";\n\nconst wb = new WalkableBuffer({\n    buffer,\n    initialCursor: 8, // First `get` operation will start at byteOffset 8\n});\n```\n\n#### Manipulate Cursor\n\nThe following \"walking\" operations will advance the cursor to the first byte after data is read:\n\n-   `get()`\n-   `getBigInt()`\n-   `getString()`\n-   `getSizedString()`\n\nThe following operations will read data _without_ manipulating the cursor:\n\n-   `peek()`\n-   `peekBigInt()`\n-   `peekString()`\n-   `peekSizedString()`\n\nTo manipulate the position of the cursor you can also\n\n-   `skip(byteLength)` to skip `byteLength` of bytes.\n-   `goTo(byteOffset)` to move cursor to a specific offset of the buffer.\n\nAnd to get the current position of the cursor, use `getCurrentPos()`.\n\n### Read Integers\n\n-   `get(byteLength, endianness, signed)` - Read `byteLength` as a signed/unsigned integer,\n    reading with `endianness`, and advancing cursor `byteLength`.\n\n-   `peek(byteLength, byteOffset, endianness, signed)` - Read `byteLength` at cursor + `byteOffset` as a\n    signed/unsigned integer, _without_ manipulating the cursor.\n\n-   `getBigInt(endianness, signed)` - Read the next 8 bytes as a signed/unsigned\n    [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)\n    , reading with `endianness`, and advancing cursor 8 steps.\n\n-   `peekBigInt(byteOffset, endianness, signed)` - Read 8 bytes at `byteOffset` as a signed/unsigned\n    [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)\n    , reading with `endianness`, _without_ manipulating the cursor.\n\n### Read Strings\n\n-   `getString(byteLength, encoding)` - Read the next `byteLength` bytes as a string, using `encoding`,\n    and advances cursor `byteLength`.\n\n-   `peekString(byteLength, byteOffset, encoding)` - Read the `byteLength` bytes at\n    cursor - `byteOffset` as a string, using `encoding`, _without_ manipulating the cursor.\n\n-   `getSizedString(sizeOfSize, endianness, encoding)` - Read the next `sizeOfSize` as an _unsigned_\n    integer with `endianness` to get byte-length, then reads that many bytes as a string with `encoding`.\n\n### Buffer\n\nYou can get the entire Buffer of WalkableBuffer back by running `getSourceBuffer()`.\n\nYou can also get Buffer of a specific `byteLength` from current cursor by running\n`getBuffer(byteLength)`. If called without `byteLength`, returns a buffer being a split from\ncurrent cursor position to end of buffer.\n\n### Size\n\nYou can get the size of the Buffer with `size()`, and get the number of bytes from current cursor\nposition to the end of the buffer, `sizeRemainingBuffer()`.\n\n## License\n\nMIT © Oscar Busk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobusk%2Fwalkable-buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobusk%2Fwalkable-buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobusk%2Fwalkable-buffer/lists"}