repowiseghostery/adblocker

Architecture of ghostery/adblocker

ghostery/adblocker is 215 source files holding 1,046 symbols across 3 modules, written mainly in TypeScript, JavaScript, Makefile. The largest module is packages, with 165 files, and 116 files are entry points into the dependency graph.

How adblocker fits together

Most of the code sits under the packages directory. The core engine is in packages/adblocker/src/engine/engine.ts, which is one of the hotspot files in the index. The packages/adblocker/src/codebooks/ directory holds modules for network filters, cosmetic selectors, network hostnames, and raw network rules. The packages/adblocker-content/package.json manifest describes the content package that sits alongside the core library. Integration packages such as @ghostery/adblocker-webextension, @ghostery/adblocker-puppeteer, and @ghostery/adblocker-electron connect the core to each host environment. The bench/comparison/blockers/ directory contains entry points for comparing this library with other blockers.

Largest modules

  • packages: 165 files and 93,842 lines of code
  • bench: 33 files and 3,980 lines of code
  • root: 11 files and 421 lines of code
  • .github: 6 files and 208 lines of code

Languages

By file count: TypeScript 108 files, JavaScript 31 files, Makefile 2 files, Python 1 file.

Documentation

Repowise documents adblocker in 192 pages generated from the source.

More on adblocker: summary and FAQ, codebase overview, code health.

Related guide: Best dependency graph tools for monorepos