{"id":18396704,"url":"https://github.com/igorskyflyer/npm-adblock-header-extract","last_synced_at":"2026-03-11T00:34:36.352Z","repository":{"id":248544783,"uuid":"829032357","full_name":"igorskyflyer/npm-adblock-header-extract","owner":"igorskyflyer","description":"✂️ Parse and extract ad-block filter list headers with ease. Works on strings or files, trims whitespace, and returns clean metadata for tooling and automation. 📃","archived":false,"fork":false,"pushed_at":"2025-09-21T23:12:55.000Z","size":190,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-22T00:25:30.666Z","etag":null,"topics":["adblock","back-end","biome","data","filter","header","igorskyflyer","javascript","js","metadata","node","nodejs","npm","string","ts","typescript","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@igorskyflyer/adblock-header-extract","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/igorskyflyer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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":{"ko_fi":"igorskyflyer"}},"created_at":"2024-07-15T16:05:53.000Z","updated_at":"2025-09-21T23:03:49.000Z","dependencies_parsed_at":"2024-07-15T18:05:32.146Z","dependency_job_id":null,"html_url":"https://github.com/igorskyflyer/npm-adblock-header-extract","commit_stats":null,"previous_names":["igorskyflyer/npm-adblock-header-extract"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/igorskyflyer/npm-adblock-header-extract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-adblock-header-extract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-adblock-header-extract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-adblock-header-extract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-adblock-header-extract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorskyflyer","download_url":"https://codeload.github.com/igorskyflyer/npm-adblock-header-extract/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-adblock-header-extract/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30364033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["adblock","back-end","biome","data","filter","header","igorskyflyer","javascript","js","metadata","node","nodejs","npm","string","ts","typescript","utility"],"created_at":"2024-11-06T02:14:37.920Z","updated_at":"2026-03-11T00:34:36.343Z","avatar_url":"https://github.com/igorskyflyer.png","language":"TypeScript","funding_links":["https://ko-fi.com/igorskyflyer"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/igorskyflyer/npm-adblock-header-extract/main/media/adblock-header-extract.png\" alt=\"Ad-block Header Extract – Node.js/TypeScript utility icon for parsing ad-block filter list headers and metadata\" width=\"256\" height=\"256\"\u003e\n  \u003ch1\u003eAd-block Header Extract\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cblockquote align=\"center\"\u003eFast Parsing • Clean Metadata • Node.js Utility • Ad-block Filters\u003c/blockquote\u003e\n\n\u003ch4 align=\"center\"\u003e\n  ✂️ Parse and extract ad-block filter list headers with ease. Works on strings or files, trims whitespace, and returns clean metadata for tooling and automation. 📃\n\u003c/h4\u003e\n\n\u003cbr\u003e\n\n## 📃 Table of Contents\n\n- [**Features**](#-features)\n- [**Usage**](#-usage)\n- [**API**](#-api)\n- [**Examples**](#️-examples)\n- [**Changelog**](#-changelog)\n- [**Support**](#-support)\n- [**License**](#-license)\n- [**Related**](#-related)\n- [**Author**](#-author)\n\n\u003cbr\u003e\n\n## 🤖 Features\n\n- ✅ Extracts ad-block filter headers quickly  \n- 📂 Reads filter files with UTF-8 support  \n- ⚡ Returns clean header strings reliably  \n- 🛡️ Handles invalid input safely\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🕵🏼 Usage\n\nInstall it by executing any of the following, depending on your preferred package manager:\n\n```bash\npnpm add @igorskyflyer/adblock-header-extract\n```\n\n```bash\nyarn add @igorskyflyer/adblock-header-extract\n```\n\n```bash\nnpm i @igorskyflyer/adblock-header-extract\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🤹🏼 API\n\n```ts\nfunction extractHeaderString(\n  filter: string,\n  trimWhitespace: boolean = true\n): string\n```\n\nExtracts the header and metadata from an Adblock filter text.\n\n- `filter` - the string that contains the Adblock filter,\n- `trimWhitespace` - should the whitespace be trimmed or not. Defaults to `true`.  \n\nReturns the extracted header.\n\n---\n\n```ts\nfunction extractHeaderString(\n  filter: string,\n  trimWhitespace: boolean = true\n): string\n```\n\nExtracts the header and metadata from an Adblock filter file. File is read with the `UTF-8` encoding by default.\n\n- `file` - the path to the filter file,\n- `trimWhitespace` - should the whitespace be trimmed or not. Defaults to `true`.\n\n\u003cbr\u003e\n\nThrows an error if the file cannot be found or there is an error in reading it.\n\nReturns the extracted header.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🗒️ Examples\n\n`example.ts`\n```ts\nimport { extractHeaderFromFile, extractHeaderString } from '@igorskyflyer/adblock-header-extract'\n\nconsole.log(extractHeaderFromFile('./filter.txt'))\n\n// will print\n\n/*\n[Adblock Plus 2.0]\n!\n!     ___        __   _    __        _      __\n!    /   |  ____/ /  | |  / /____   (_)____/ /\n!   / /| | / __  /   | | / // __ \\ / // __  /\n!  / ___ |/ /_/ /    | |/ // /_/ // // /_/ /\n! /_/  |_|\\____/     |___/ \\____//_/ \\____/\n!\n!\n! {@!}\n! Title: AdVoid.Full\n! Description: Blocks major ad-servers, trackers, malware, fake download links, cookie-consent banners, popups, modals, push notifications, survey, newsletter and subscribe popups, sharing, Google Chromecast, popup chats, post widgets, like widgets, comments, service workers, news widgets, JavaScript and CSS maps, PWA install banners, Webmanifests, SWF objects\n! Version: 3.0.3340\n! Last modified: 2024-07-15T02:07:07.895+02:00\n! Expires: 24 hours (update frequency)\n! Homepage: https://github.com/the-advoid/ad-void\n! Entries: 6615\n! Author: Igor Dimitrijević (@igorskyflyer)\n! GitHub issues: https://github.com/the-advoid/ad-void/issues\n! GitHub pull requests: https://github.com/the-advoid/ad-void/pulls\n! License: https://github.com/the-advoid/ad-void/blob/main/LICENSE\n! Maintained by: Aria, igorskyflyer and all of the contributors\n! See the CONTRIBUTORS.md (https://github.com/the-advoid/ad-void/blob/main/CONTRIBUTORS.md) file for more information\n! Source: World Wide Web\n*/\n```\n\n\u003cbr\u003e\n\n`./filter.txt`\n```adblock\n[Adblock Plus 2.0]\n!\n!     ___        __   _    __        _      __\n!    /   |  ____/ /  | |  / /____   (_)____/ /\n!   / /| | / __  /   | | / // __ \\ / // __  /\n!  / ___ |/ /_/ /    | |/ // /_/ // // /_/ /\n! /_/  |_|\\____/     |___/ \\____//_/ \\____/\n!\n!\n! {@!}\n! Title: AdVoid.Full\n! Description: Blocks major ad-servers, trackers, malware, fake download links, cookie-consent banners, popups, modals, push notifications, survey, newsletter and subscribe popups, sharing, Google Chromecast, popup chats, post widgets, like widgets, comments, service workers, news widgets, JavaScript and CSS maps, PWA install banners, Webmanifests, SWF objects\n! Version: 3.0.3340\n! Last modified: 2024-07-15T02:07:07.895+02:00\n! Expires: 24 hours (update frequency)\n! Homepage: https://github.com/the-advoid/ad-void\n! Entries: 6615\n! Author: Igor Dimitrijević (@igorskyflyer)\n! GitHub issues: https://github.com/the-advoid/ad-void/issues\n! GitHub pull requests: https://github.com/the-advoid/ad-void/pulls\n! License: https://github.com/the-advoid/ad-void/blob/main/LICENSE\n! Maintained by: Aria, igorskyflyer and all of the contributors\n! See the CONTRIBUTORS.md (https://github.com/the-advoid/ad-void/blob/main/CONTRIBUTORS.md) file for more information\n! Source: World Wide Web\n\n! {@0} Domains (global)\n||02cscosgbuzl.top^\n||05e11c9f6f.com^\n||0af2a962b0102942d9a7df351b20be55.com^\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 📝 Changelog\n\n📑 Read about the latest changes in the [**CHANGELOG**](https://github.com/igorskyflyer/npm-adblock-header-extract/blob/main/CHANGELOG.md).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🪪 License\n\nLicensed under the [**MIT license**](https://github.com/igorskyflyer/npm-adblock-header-extract/blob/main/LICENSE).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 💖 Support\n\n\u003cdiv align=\"center\"\u003e\n  I work hard for every project, including this one and your support means a lot to me!\n  \u003cbr\u003e\n  Consider buying me a coffee. ☕\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://ko-fi.com/igorskyflyer\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/igorskyflyer/igorskyflyer/main/assets/ko-fi.png\" alt=\"Donate to igorskyflyer\" width=\"180\" height=\"46\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cem\u003eThank you for supporting my efforts!\u003c/em\u003e 🙏😊\n\u003c/div\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🧬 Related\n\n[**@igorskyflyer/normalized-string**](https://www.npmjs.com/package/@igorskyflyer/normalized-string)\n\n\u003e _💊 NormalizedString provides you with a String type with consistent line-endings, guaranteed. 📮_\n\n\u003cbr\u003e\n\n[**@igorskyflyer/zep**](https://www.npmjs.com/package/@igorskyflyer/zep)\n\n\u003e _🧠 Zep is a zero-dependency, efficient debounce module. ⏰_\n\n\u003cbr\u003e\n\n[**@igorskyflyer/mapped-replacer**](https://www.npmjs.com/package/@igorskyflyer/mapped-replacer)\n\n\u003e _🦗 Zero-dependency Map and RegExp based string replacer with Unicode support. 🍁_\n\n\u003cbr\u003e\n\n[**@igorskyflyer/strip-yaml-front-matter**](https://www.npmjs.com/package/@igorskyflyer/strip-yaml-front-matter)\n\n\u003e _🦓 Strips YAML front matter from a String or a file. 👾_\n\n\u003cbr\u003e\n\n[**@igorskyflyer/strip-html**](https://www.npmjs.com/package/@igorskyflyer/strip-html)\n\n\u003e _🥞 Removes HTML code from the given string. Can even extract text-only from the given an HTML string. ✨_\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 👨🏻‍💻 Author\nCreated by **Igor Dimitrijević ([*@igorskyflyer*](https://github.com/igorskyflyer/))**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorskyflyer%2Fnpm-adblock-header-extract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorskyflyer%2Fnpm-adblock-header-extract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorskyflyer%2Fnpm-adblock-header-extract/lists"}