npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-boundaries

v7.4.5

Published

Eslint plugin checking architecture boundaries between elements

Readme

License Build status Coverage Status Quality Gate

NPM downloads Renovate Last commit Last release

JS Boundaries

Lint your architecture, not just your syntax.

An ESLint plugin for JavaScript and TypeScript projects. Classify your files, write policies for who may depend on whom, and get an ESLint error the moment a boundary is crossed. In your IDE, in CI, with nothing new to run.

Documentation: jsboundaries.dev Playground: try it in your browser

Installation

npm install --save-dev eslint eslint-plugin-boundaries

Playground

The playground runs the classification of the plugin and its boundaries/dependencies rule in your browser, on a project you sketch: paste a config, lay out a folder tree, and watch each file get classified and each import get its verdict. It opens with the example of "How it works", below, already running on a sample project.

How it works

From folder tree to enforced architecture in three edits.

1. Classify files and elements

Element descriptors match folders. File descriptors match files on their own, so a file can be a component and a test at the same time. You only need one of the two to start.

settings: {
  "boundaries/elements": [
    { type: "helper",    pattern: "helpers/*" },
    { type: "component", pattern: "components/*/*" },
    { type: "module",    pattern: "modules/*" },
  ],
  "boundaries/files": [
    { pattern: "**/*.spec.js", category: "test" },
  ],
}

2. Write the policies

Pick a default, then allow or disallow by any combination of element type, file category, module origin and dependency kind. Captured path fragments let one policy cover a whole family of elements.

"boundaries/dependencies": [2, {
  default: "disallow",
  policies: [
    { from: { element: { type: "component" } },
      allow: { to: { element: { type: "helper" } } } },
    { from: { element: { type: "module" } },
      allow: { to: { element: { types: ["component", "helper"] } } } },
    { disallow: { to: { file: { categories: "test" } } },
      message: "Never import test files from {{ from.element.types.[0] }}s" },
  ],
}]

3. Read the error where you wrote the import

Violations are ordinary ESLint errors: editor squiggles, CI failures, templated messages with the element types on both sides. Three more rules catch files outside your architecture, unknown dependencies and ignored ones.

src/helpers/format/index.js
  1:22  error  There is no policy allowing dependencies from
         elements of type "helper" to elements of type "component"
         boundaries/dependencies

✖ 1 problem (1 error, 0 warnings)

The quick start puts these pieces together in a complete eslint.config.js.

Packages

JS Boundaries is published as these packages:

| Package | Description | | --- | --- | | eslint-plugin-boundaries | The ESLint plugin, also published as @boundaries/eslint-plugin. | | @boundaries/elements | Entity descriptors and matchers for @boundaries tools. | | @boundaries/config | Normalization and validation of the settings and rule options of the plugin, without ESLint. | | @boundaries/policies | Evaluation of the dependency policies of the plugin and their messages, without ESLint. | | @boundaries/analysis | Evaluation of a whole project against a config: the description of each file and the verdict of each dependency, without ESLint. |

Contributing

Thank you to everyone who has reported issues, suggested improvements or contributed code. To get involved, open an issue, join the discussions or read the contributing guidelines.

License

MIT © javierbrea