igorskyflyer / npm-adblock-filter-counter

🐲 A dead simple npm module that counts Adblock filter rules.🦘

Home Page:https://www.npmjs.com/package/@igor.dvlpr/adblock-filter-counter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adblock-filter-counter

🐲 A dead simple npm module that counts Adblock filter rules.🦘


πŸ’– Support further development

Donate to igorskyflyer



πŸ•΅πŸΌβ€β™‚οΈ Usage

Install it by executing:

npm i "@igor.dvlpr/adblock-filter-counter"

πŸ€ΉπŸΌβ€β™‚οΈ API

countRules(rules: string): number

Counts Adblock filter rules found in the provided string.


rules - The Adblock filter string to count rules in.


Returns the number of filter rules. Throws a TypeError if no input is passed or if it's not a string.



countFileRules(path: PathLike): number

Counts Adblock filter rules found in the provided file.


path - The path to the file that contains the filter rules to count.


Returns the number of filter rules. Throws an Error if the given path cannot be found.

About

🐲 A dead simple npm module that counts Adblock filter rules.🦘

https://www.npmjs.com/package/@igor.dvlpr/adblock-filter-counter

License:MIT License


Languages

Language:TypeScript 100.0%