{"id":13548217,"url":"https://github.com/pugjs/token-stream","last_synced_at":"2025-10-08T23:06:13.545Z","repository":{"id":23546303,"uuid":"26913395","full_name":"pugjs/token-stream","owner":"pugjs","description":"Take an array of token and produce a more useful API to give to a parser","archived":false,"fork":false,"pushed_at":"2024-08-16T09:31:30.000Z","size":6,"stargazers_count":12,"open_issues_count":2,"forks_count":3,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-08-19T22:06:28.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/pugjs.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-20T13:25:44.000Z","updated_at":"2024-12-22T13:32:01.000Z","dependencies_parsed_at":"2024-12-16T09:23:33.748Z","dependency_job_id":"4bfb9ac0-ddea-42ac-bd81-63b7c7f02db7","html_url":"https://github.com/pugjs/token-stream","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.5,"last_synced_commit":"27b40c73b837a7f505de1289d8d1fd21234690bc"},"previous_names":["jadejs/token-stream"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pugjs/token-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pugjs%2Ftoken-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pugjs%2Ftoken-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pugjs%2Ftoken-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pugjs%2Ftoken-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pugjs","download_url":"https://codeload.github.com/pugjs/token-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pugjs%2Ftoken-stream/sbom","scorecard":{"id":749247,"data":{"date":"2025-08-11","repo":{"name":"github.com/pugjs/token-stream","commit":"27b40c73b837a7f505de1289d8d1fd21234690bc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":-1,"reason":"no workflows found","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/11 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":"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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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 'master'"],"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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"}}]},"last_synced_at":"2025-08-22T19:46:40.197Z","repository_id":23546303,"created_at":"2025-08-22T19:46:40.197Z","updated_at":"2025-08-22T19:46:40.197Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277942684,"owners_count":25903112,"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-01T02:00:09.286Z","response_time":88,"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":[],"created_at":"2024-08-01T12:01:07.336Z","updated_at":"2025-10-08T23:06:13.501Z","avatar_url":"https://github.com/pugjs.png","language":"JavaScript","readme":"# token-stream\n\nTake an array of token and produce a more useful API to give to a parser.\n\n[![Build Status](https://img.shields.io/travis/pugjs/token-stream/master.svg)](https://travis-ci.org/pugjs/token-stream)\n[![Dependency Status](https://img.shields.io/david/pugjs/token-stream.svg)](https://david-dm.org/pugjs/token-stream)\n[![NPM version](https://img.shields.io/npm/v/token-stream.svg)](https://www.npmjs.org/package/token-stream)\n\n## Installation\n\n    npm install token-stream\n\n## Usage\n\n```js\nvar TokenStream = require('token-stream');\n\nvar stream = new TokenStream([\n  'a',\n  'b',\n  'c',\n  'd'\n]);\nassert(stream.peek() === 'a');\nassert(stream.lookahead(0) == 'a');\nassert(stream.lookahead(1) == 'b');\n\nassert(stream.advance() === 'a');\nassert(stream.peek() === 'b');\nassert(stream.lookahead(0) == 'b');\nassert(stream.lookahead(1) == 'c');\n\nstream.defer('z');\nassert(stream.peek() === 'z');\nassert(stream.lookahead(0) == 'z');\nassert(stream.lookahead(1) == 'b');\nassert(stream.advance() === 'z');\nassert(stream.advance() === 'b');\nassert(stream.advance() === 'c');\nassert(stream.advance() === 'd');\n\n// an error is thrown if you try and advance beyond the end of the stream\nassert.throws(function () {\n  stream.advance();\n});\n```\n\n## API\n\n### stream.peek()\n\nGets and returns the next item in the stream without advancing the stream's position.\n\n### stream.advance()\n\nReturns the next item in the stream and advances the stream by one item.\n\n### stream.defer(token)\n\nPut a token on the start of the stream (useful if you need to back track after calling advance).\n\n### stream.lookahead(index)\n\nReturn the item at `index` position from the start of the stream, but don't advance the stream.  `stream.lookahead(0)` is equivalent to `stream.peek()`.\n\n## License\n\n  MIT\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpugjs%2Ftoken-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpugjs%2Ftoken-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpugjs%2Ftoken-stream/lists"}