{"id":13717111,"url":"https://github.com/syntax-tree/nlcst-is-literal","last_synced_at":"2025-10-14T18:41:30.246Z","repository":{"id":58241558,"uuid":"41305103","full_name":"syntax-tree/nlcst-is-literal","owner":"syntax-tree","description":"utility to check whether an nlcst node is meant literally","archived":false,"fork":false,"pushed_at":"2025-01-03T14:18:14.000Z","size":138,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-10-08T03:39:20.776Z","etag":null,"topics":["nlcst","nlcst-util","syntax-tree","unist","util"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","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/syntax-tree.png","metadata":{"funding":{"github":"unifiedjs","open_collective":"unified","thanks_dev":"u/gh/syntax-tree"},"files":{"readme":"readme.md","changelog":null,"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,"zenodo":null}},"created_at":"2015-08-24T13:37:55.000Z","updated_at":"2025-01-03T14:18:17.000Z","dependencies_parsed_at":"2024-01-14T22:03:44.213Z","dependency_job_id":"7073c146-991f-4b5d-a9d6-06e390564b5f","html_url":"https://github.com/syntax-tree/nlcst-is-literal","commit_stats":{"total_commits":92,"total_committers":3,"mean_commits":"30.666666666666668","dds":"0.021739130434782594","last_synced_commit":"15a303d033fd74d6f651a7ee93a4890635586fe0"},"previous_names":["wooorm/nlcst-is-literal"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/syntax-tree/nlcst-is-literal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-is-literal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-is-literal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-is-literal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-is-literal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntax-tree","download_url":"https://codeload.github.com/syntax-tree/nlcst-is-literal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fnlcst-is-literal/sbom","scorecard":{"id":863505,"data":{"date":"2025-08-11","repo":{"name":"github.com/syntax-tree/nlcst-is-literal","commit":"942dcec0631f48ce1ce0eee33b74b73d630991bc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/bb.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/nlcst-is-literal/bb.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:6: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/nlcst-is-literal/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/nlcst-is-literal/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/nlcst-is-literal/main.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:11","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/bb.yml:1","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":"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":"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":"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: 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":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.2.2 not signed: https://api.github.com/repos/syntax-tree/nlcst-is-literal/releases/33322844","Warn: release artifact 1.2.2 does not have provenance: https://api.github.com/repos/syntax-tree/nlcst-is-literal/releases/33322844"],"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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/syntax-tree/.github/security.md:1","Info: Found linked content: github.com/syntax-tree/.github/security.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/syntax-tree/.github/security.md:1","Info: Found text in security policy: github.com/syntax-tree/.github/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"}}]},"last_synced_at":"2025-08-24T02:01:09.742Z","repository_id":58241558,"created_at":"2025-08-24T02:01:09.742Z","updated_at":"2025-08-24T02:01:09.742Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020361,"owners_count":26086866,"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-14T02:00:06.444Z","response_time":60,"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":["nlcst","nlcst-util","syntax-tree","unist","util"],"created_at":"2024-08-03T00:01:18.045Z","updated_at":"2025-10-14T18:41:30.216Z","avatar_url":"https://github.com/syntax-tree.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified","https://thanks.dev/u/gh/syntax-tree"],"categories":["nlcst utilities"],"sub_categories":[],"readme":"# nlcst-is-literal\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[nlcst][] utility to check if a node is meant literally.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`isLiteral(parent, index|child)`](#isliteralparent-indexchild)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis utility can check if a node is meant literally.\n\n## When should I use this?\n\nThis package is a tiny utility that helps when dealing with words.\nIt’s useful if a tool wants to exclude values that are possibly void of\nmeaning.\nFor example, a spell-checker could exclude these literal words, thus not warning\nabout “monsieur”.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install nlcst-is-literal\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {isLiteral} from 'https://esm.sh/nlcst-is-literal@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {isLiteral} from 'https://esm.sh/nlcst-is-literal@3?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\nSay our document `example.txt` contains:\n\n```txt\nThe word “foo” is meant as a literal.\n\nThe word «bar» is meant as a literal.\n\nThe word (baz) is meant as a literal.\n\nThe word, qux, is meant as a literal.\n\nThe word — quux — is meant as a literal.\n```\n\n…and our module `example.js` looks as follows:\n\n```js\nimport {read} from 'to-vfile'\nimport {ParseEnglish} from 'parse-english'\nimport {visit} from 'unist-util-visit'\nimport {toString} from 'nlcst-to-string'\nimport {isLiteral} from 'nlcst-is-literal'\n\nconst file = await read('example.txt')\nconst tree = new ParseEnglish().parse(String(file))\n\nvisit(tree, 'WordNode', function (node, index, parent) {\n  if (isLiteral(parent, index)) {\n    console.log(toString(node))\n  }\n})\n```\n\n…now running `node example.js` yields:\n\n```txt\nfoo\nbar\nbaz\nqux\nquux\n```\n\n## API\n\nThis package exports the identifier [`isLiteral`][api-is-literal].\nThere is no default export.\n\n### `isLiteral(parent, index|child)`\n\nCheck if the child in `parent` at `index` is enclosed by matching delimiters.\n\nFor example, `foo` is literal in the following samples:\n\n* `Foo - is meant as a literal.`\n* `Meant as a literal is - foo.`\n* `The word “foo” is meant as a literal.`\n\n###### Parameters\n\n* `parent` ([`Node`][node])\n  — parent node\n* `index` (`number`)\n  — index of child in parent\n* `child` ([`Node`][node])\n  — child node of parent\n\n###### Returns\n\nWhether the child is a literal (`boolean`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `nlcst-is-literal@^3`,\ncompatible with Node.js 16.\n\n## Related\n\n* [`nlcst-normalize`](https://github.com/syntax-tree/nlcst-normalize)\n  — normalize a word for easier comparison\n* [`nlcst-search`](https://github.com/syntax-tree/nlcst-search)\n  — search for patterns\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/syntax-tree/nlcst-is-literal/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/nlcst-is-literal/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/nlcst-is-literal.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/nlcst-is-literal\n\n[downloads-badge]: https://img.shields.io/npm/dm/nlcst-is-literal.svg\n\n[downloads]: https://www.npmjs.com/package/nlcst-is-literal\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size\u0026query=$.size.compressedSize\u0026url=https://deno.bundlejs.com/?q=nlcst-is-literal\n\n[size]: https://bundlejs.com/?q=nlcst-is-literal\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[nlcst]: https://github.com/syntax-tree/nlcst\n\n[node]: https://github.com/syntax-tree/nlcst#nodes\n\n[api-is-literal]: #isliteralparent-indexchild\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fnlcst-is-literal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntax-tree%2Fnlcst-is-literal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fnlcst-is-literal/lists"}