{"id":14563539,"url":"https://github.com/dbushell/hyperless","last_synced_at":"2025-04-10T22:53:52.614Z","repository":{"id":255436096,"uuid":"849719436","full_name":"dbushell/hyperless","owner":"dbushell","description":"🧼 HTML parser and various utilities","archived":false,"fork":false,"pushed_at":"2024-10-23T07:27:44.000Z","size":111,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T22:53:47.025Z","etag":null,"topics":["bun","deno","html","javascript","nodejs","typescript"],"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/dbushell.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}},"created_at":"2024-08-30T05:45:40.000Z","updated_at":"2024-10-23T07:27:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"dbfdcc64-2e83-4f3e-a30e-a2fb6968fc8a","html_url":"https://github.com/dbushell/hyperless","commit_stats":{"total_commits":52,"total_committers":1,"mean_commits":52.0,"dds":0.0,"last_synced_commit":"6b125ec80f2ad16a5672d5c6ee0a2cf0512de69c"},"previous_names":["dbushell/hyperless"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fhyperless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fhyperless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fhyperless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fhyperless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbushell","download_url":"https://codeload.github.com/dbushell/hyperless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312172,"owners_count":21082638,"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","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":["bun","deno","html","javascript","nodejs","typescript"],"created_at":"2024-09-07T02:02:18.790Z","updated_at":"2025-04-10T22:53:52.584Z","avatar_url":"https://github.com/dbushell.png","language":"TypeScript","funding_links":[],"categories":["typescript"],"sub_categories":[],"readme":"# 🧼 Hyperless\n\n[![JSR](https://jsr.io/badges/@dbushell/hyperless?labelColor=98e6c8\u0026color=333)](https://jsr.io/@dbushell/hyperless) [![NPM](https://img.shields.io/npm/v/@dbushell/hyperless?labelColor=98e6c8\u0026color=333)](https://www.npmjs.com/package/@dbushell/hyperless)\n\nHTML parser and various utilities.\n\n## `parseHTML`\n\nParse an HTML document or fragment into a traversable node tree.\n\n```javascript\nimport {parseHTML} from '@dbushell/hyperless';\nconst root = parseHTML('\u003ch1\u003eHello, World!\u003c/h1\u003e');\n```\n\nNode API subject to change.\n\n## `parseAttributes`\n\nParse an HTML attribute string into a case-insensitive deduplicated key/value map.\n\n```javascript\nimport {parseAttributes} from '@dbushell/hyperless';\nconst map = parseAttributes('a=\"1\" b=\"2\" c d=\"d\" D=\"d\" e=e');\n```\n\nHTML entity encoding is handled automatically by default.\n\n## Utilities\n\n### `stripTags`\n\nRemove HTML and return text content with a few niceties.\n\n```javascript\nimport {stripTags} from '@dbushell/hyperless';\n// Pass a chunk of HTML\nconst text = stripTags('\u003cp\u003eCeci n’est pas une paragraphe.\u003c/p\u003e');\n```\n\nText in `\u003cblockquote\u003e` and `\u003cq\u003e` are wrapped in quotation marks.\n\n### `excerpt`\n\nGenerate a text excerpt from HTML content.\n\n```javascript\nimport {excerpt} from '@dbushell/hyperless';\n// Pass a chunk of HTML\nconst text = excerpt(html);\n```\n\nOutput is context aware trimmed to the nearest sentence, or word, to fit the maximum length as close as possible.\n\nAn optional `maxLength` can be passed as the second argument (default: `300` characters).\n\n* * *\n\n[MIT License](/LICENSE) | Copyright © 2024 [David Bushell](https://dbushell.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbushell%2Fhyperless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbushell%2Fhyperless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbushell%2Fhyperless/lists"}