Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/igorskyflyer/npm-adblock-filter-counter
๐ฒ A dead simple npm module that counts Adblock filter rules.๐ฆ
https://github.com/igorskyflyer/npm-adblock-filter-counter
adblock adblocker back-end counter igorskyflyer javascript js library npm string typescript utility
Last synced: 10 days ago
JSON representation
๐ฒ A dead simple npm module that counts Adblock filter rules.๐ฆ
- Host: GitHub
- URL: https://github.com/igorskyflyer/npm-adblock-filter-counter
- Owner: igorskyflyer
- License: mit
- Created: 2023-07-02T22:38:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-03T19:10:20.000Z (over 1 year ago)
- Last Synced: 2024-12-07T03:09:01.008Z (2 months ago)
- Topics: adblock, adblocker, back-end, counter, igorskyflyer, javascript, js, library, npm, string, typescript, utility
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@igor.dvlpr/adblock-filter-counter
- Size: 32.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# adblock-filter-counter
๐ฒ A dead simple npm module that counts Adblock filter rules.๐ฆ
## ๐ต๐ผโโ๏ธ Usage
Install it by executing:
```shell
npm i "@igor.dvlpr/adblock-filter-counter"
```
## ๐คน๐ผโโ๏ธ API
```ts
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.
```ts
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.