{"id":16228521,"url":"https://github.com/poppa/string-walker","last_synced_at":"2026-02-14T16:32:01.945Z","repository":{"id":35123155,"uuid":"209602049","full_name":"poppa/string-walker","owner":"poppa","description":"Navigate within a string","archived":false,"fork":false,"pushed_at":"2024-06-18T16:59:05.000Z","size":1177,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-21T01:54:11.277Z","etag":null,"topics":["parser","string-manipulation","strings","tokenizer"],"latest_commit_sha":null,"homepage":null,"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/poppa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-19T16:37:13.000Z","updated_at":"2022-03-31T18:37:56.000Z","dependencies_parsed_at":"2024-08-30T01:42:19.030Z","dependency_job_id":null,"html_url":"https://github.com/poppa/string-walker","commit_stats":{"total_commits":47,"total_committers":3,"mean_commits":"15.666666666666666","dds":"0.42553191489361697","last_synced_commit":"4275bf1df66df579f9539186563d3efb282a1a03"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/poppa/string-walker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poppa%2Fstring-walker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poppa%2Fstring-walker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poppa%2Fstring-walker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poppa%2Fstring-walker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poppa","download_url":"https://codeload.github.com/poppa/string-walker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poppa%2Fstring-walker/sbom","scorecard":{"id":741148,"data":{"date":"2025-08-11","repo":{"name":"github.com/poppa/string-walker","commit":"4275bf1df66df579f9539186563d3efb282a1a03"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"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":"Code-Review","score":0,"reason":"Found 0/9 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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/poppa/string-walker/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/poppa/string-walker/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/poppa/string-walker/main.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 21 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":3,"reason":"7 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-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-22T17:30:38.207Z","repository_id":35123155,"created_at":"2025-08-22T17:30:38.207Z","updated_at":"2025-08-22T17:30:38.207Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29449369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["parser","string-manipulation","strings","tokenizer"],"created_at":"2024-10-10T12:55:40.544Z","updated_at":"2026-02-14T16:32:01.929Z","avatar_url":"https://github.com/poppa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# string-walker\nThis is a simple class that lets you navigate within a string. This is useful\nwhen creating simple tokenizers for instance.\n\n# Examples\n\n**Print each character in the string**\n\n```ts\nimport { StringWalker } from 'string-walker'\n\nconst str = 'My name is Pontus'\nconst s = new StringWalker(str)\n\nwhile (!s.isEof()) {\n  console.log(s.currentChar())\n  s.next()\n}\n\n/*\nOutputs:\nM\ny\n\nn\na\nm\ne\n\ni\ns\n\nP\no\nn\nt\nu\ns\n*/\n```\n\n**Tokenize a simple key/value file**\n\nSay we have a key/value file that allows for a syntax like:\n\n```\nkey1: strvalue\nkey2 :  12\nkey3:some value\n```\n\nWe don't care about the whitespace between the key, separator and value\n\n```ts\nimport { StringWalker } from 'string-walker'\n\nconst str = `\nkey1: strvalue\nkey2 :  12\nkey3:some value`\n\nconst tokens: Array\u003c{ type: string, value: string }\u003e = []\nconst s = new StringWalker(str)\n\nlet state: 'key' | 'value' | 'none' = 'none'\n\nwhile (!s.isEof()) {\n  // Consume whitespace\n  if (['\\n', ' ', '\\t'].includes(s.currentChar())) {\n    s.consume(['\\n', ' ', '\\t'])\n  }\n\n  switch (state) {\n    // When state is none we're expecting a key\n    case 'none': {\n      // Find the position of either space, tab or :\n      const end = s.findNextOf([' ', '\\t', ':'])\n\n      // If end is NaN we got to the end of the string without finding\n      // what we are looking for\n      if (isNaN(end)) {\n        throw new Error('Syntax error')\n      }\n\n      // The key is located from the current position to `end`\n      const key = s.substring(s.position, end)\n      tokens.push({ type: 'key', value: key })\n\n      // Now move the cursor to where we found the character\n      s.moveTo(end)\n\n      state = 'key'\n\n      break\n    }\n\n    // When state is `key` we're expecting the next token to be a delimiter\n    case 'key': {\n      if (s.currentChar() !== ':') {\n        throw new Error(`Syntax error: Expected : got ${s.currentChar()}`)\n      }\n\n      tokens.push({ type: 'delimiter', value: ':' })\n\n      // Next we're expecting a value\n      state = 'value'\n\n      // Move the cursor to the next position\n      s.next()\n\n      break\n    }\n\n    case 'value': {\n      // The value should stretch to the end of the line\n      let end = s.findNext('\\n')\n\n      // If end is NaN we've reached the end of the string\n      if (isNaN(end)) {\n        end = s.length\n      }\n\n      const val = s.substring(s.position, end)\n      tokens.push({ type: 'value', value: val })\n      s.moveTo(end)\n\n      // Now we're expecting either whitespace to the end or a new key\n      state = 'none'\n\n      break\n    }\n\n    // We should never get here\n    default:\n      throw new Error('Unknown stuff')\n  }\n}\n\nconsole.log(tokens)\n\n/*\nExpected output:\n[\n  { type: 'key', value: 'key1' },\n  { type: 'delimiter', value: ':' },\n  { type: 'value', value: 'strvalue' },\n  { type: 'key', value: 'key2' },\n  { type: 'delimiter', value: ':' },\n  { type: 'value', value: '12' },\n  { type: 'key', value: 'key3' },\n  { type: 'delimiter', value: ':' },\n  { type: 'value', value: 'some value' }\n]\n*/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoppa%2Fstring-walker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoppa%2Fstring-walker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoppa%2Fstring-walker/lists"}