{"id":13339499,"url":"https://github.com/syntax-tree/hast-util-whitespace","last_synced_at":"2026-02-03T19:14:19.861Z","repository":{"id":7417938,"uuid":"56331326","full_name":"syntax-tree/hast-util-whitespace","owner":"syntax-tree","description":"utility to check if a node is inter-element whitespace","archived":false,"fork":false,"pushed_at":"2023-07-31T15:52:10.000Z","size":94,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-01-29T21:27:41.633Z","etag":null,"topics":["hast","hast-util","html","syntax-tree","unist","util","white-space","whitespace"],"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":{"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},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2016-04-15T15:42:30.000Z","updated_at":"2023-05-04T01:00:49.000Z","dependencies_parsed_at":"2024-06-18T18:12:52.405Z","dependency_job_id":"d9c88263-4409-4cbb-8af0-f1e6b6b46aca","html_url":"https://github.com/syntax-tree/hast-util-whitespace","commit_stats":{"total_commits":86,"total_committers":3,"mean_commits":"28.666666666666668","dds":"0.023255813953488413","last_synced_commit":"22b88c3f4d51f3777929758e980c257a2838a4b2"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/syntax-tree/hast-util-whitespace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast-util-whitespace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast-util-whitespace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast-util-whitespace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast-util-whitespace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntax-tree","download_url":"https://codeload.github.com/syntax-tree/hast-util-whitespace/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast-util-whitespace/sbom","scorecard":{"id":863468,"data":{"date":"2025-08-11","repo":{"name":"github.com/syntax-tree/hast-util-whitespace","commit":"22b88c3f4d51f3777929758e980c257a2838a4b2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"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":"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":"Code-Review","score":0,"reason":"Found 1/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":"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":"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":"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":"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/hast-util-whitespace/bb.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/hast-util-whitespace/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/hast-util-whitespace/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/hast-util-whitespace/main.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:15","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":"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":"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":"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":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.0.4 not signed: https://api.github.com/repos/syntax-tree/hast-util-whitespace/releases/24051263","Warn: release artifact 1.0.3 not signed: https://api.github.com/repos/syntax-tree/hast-util-whitespace/releases/17591586","Warn: release artifact 1.0.4 does not have provenance: https://api.github.com/repos/syntax-tree/hast-util-whitespace/releases/24051263","Warn: release artifact 1.0.3 does not have provenance: https://api.github.com/repos/syntax-tree/hast-util-whitespace/releases/17591586"],"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 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-24T02:00:43.460Z","repository_id":7417938,"created_at":"2025-08-24T02:00:43.460Z","updated_at":"2025-08-24T02:00:43.460Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29054202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: 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":["hast","hast-util","html","syntax-tree","unist","util","white-space","whitespace"],"created_at":"2024-07-29T19:20:04.206Z","updated_at":"2026-02-03T19:14:18.300Z","avatar_url":"https://github.com/syntax-tree.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":[],"sub_categories":[],"readme":"# hast-util-whitespace\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[hast][] utility to check if a node is [*inter-element whitespace*][spec].\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    *   [`whitespace(thing)`](#whitespacething)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a small utility that checks if a node is whitespace according to\nHTML.\n\n## When should I use this?\n\nThis utility is super niche, if you’re here you probably know what you’re\nlooking for!\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install hast-util-whitespace\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {whitespace} from 'https://esm.sh/hast-util-whitespace@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {whitespace} from 'https://esm.sh/hast-util-whitespace@3?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {whitespace} from 'hast-util-whitespace'\n\nwhitespace({\n  type: 'element',\n  tagName: 'div',\n  properties: {},\n  children: []\n}) // =\u003e false\n\nwhitespace({\n  type: 'text',\n  value: '\\t  \\n'\n}) // =\u003e true\n\nwhitespace({\n  type: 'text',\n  value: '  text\\f'\n}) // =\u003e false\n```\n\n## API\n\nThis package exports the identifier [`whitespace`][api-whitespace].\nThere is no default export.\n\n### `whitespace(thing)`\n\nCheck if the given value is [*inter-element whitespace*][spec].\n\n###### Parameters\n\n*   `thing` ([`Node`][node] or `string`, optional)\n    — thing to check\n\n###### Returns\n\nWhether the `value` is inter-element whitespace (`boolean`): consisting of zero\nor more of space, tab (`\\t`), line feed (`\\n`), carriage return (`\\r`), or form\nfeed (`\\f`).\nIf a node is passed it must be a [`Text`][text] node, whose `value` field is\nchecked.\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, `hast-util-whitespace@^3`,\ncompatible with Node.js 16.\n\n## Security\n\n`hast-util-whitespace` does not change the syntax tree so there are no openings\nfor [cross-site scripting (XSS)][xss] attacks.\n\n## Related\n\n*   [`hast-util-is-element`](https://github.com/syntax-tree/hast-util-is-element)\n    — check if a node is a (certain) element\n*   [`hast-util-has-property`](https://github.com/syntax-tree/hast-util-has-property)\n    — check if a node has a property\n*   [`hast-util-transparent`](https://github.com/syntax-tree/hast-util-transparent)\n    — check if a node is a transparent element\n*   [`hast-util-heading`](https://github.com/syntax-tree/hast-util-heading)\n    — check if a node is a heading element\n*   [`hast-util-labelable`](https://github.com/syntax-tree/hast-util-labelable)\n    — check whether a node is labelable\n*   [`hast-util-phrasing`](https://github.com/syntax-tree/hast-util-phrasing)\n    — check if a node is phrasing content\n*   [`hast-util-embedded`](https://github.com/syntax-tree/hast-util-embedded)\n    — check if a node is an embedded element\n*   [`hast-util-sectioning`](https://github.com/syntax-tree/hast-util-sectioning)\n    — check if a node is a sectioning element\n*   [`hast-util-interactive`](https://github.com/syntax-tree/hast-util-interactive)\n    — check if a node is interactive\n*   [`hast-util-script-supporting`](https://github.com/syntax-tree/hast-util-script-supporting)\n    — check if a node is a script-supporting element\n*   [`hast-util-is-body-ok-link`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-body-ok-link)\n    — check if a node is “Body OK” link element\n*   [`hast-util-is-conditional-comment`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-conditional-comment)\n    — check if a node is a conditional comment\n*   [`hast-util-is-css-link`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-css-link)\n    — check if a node is a CSS link element\n*   [`hast-util-is-css-style`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-css-style)\n    — check if a node is a CSS style element\n*   [`hast-util-is-javascript`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-javascript)\n    — check if a node is a JavaScript script element\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!-- Definition --\u003e\n\n[build-badge]: https://github.com/syntax-tree/hast-util-whitespace/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/hast-util-whitespace/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-whitespace.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/hast-util-whitespace\n\n[downloads-badge]: https://img.shields.io/npm/dm/hast-util-whitespace.svg\n\n[downloads]: https://www.npmjs.com/package/hast-util-whitespace\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size\u0026query=$.size.compressedSize\u0026url=https://deno.bundlejs.com/?q=hast-util-whitespace\n\n[size]: https://bundlejs.com/?q=hast-util-whitespace\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[hast]: https://github.com/syntax-tree/hast\n\n[spec]: https://html.spec.whatwg.org/multipage/dom.html#inter-element-whitespace\n\n[node]: https://github.com/syntax-tree/hast#nodes\n\n[text]: https://github.com/syntax-tree/hast#text\n\n[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[api-whitespace]: #whitespacething\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fhast-util-whitespace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntax-tree%2Fhast-util-whitespace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fhast-util-whitespace/lists"}