Local & literal
License Gate reads what is physically installed via @npmcli/arborist and compares each package’s license string verbatim against your allowlist. Apache 2.0 is not Apache-2.0. It does not guess, infer, or normalise.
Open-source engineering tool by Mirasen
A strict, local, default-deny license policy gate for npm projects — single package, workspaces, and monorepos.
Overview
License Gate reads what is physically installed and enforces a local allowlist you control. It refuses to guess, and it makes every exception visible.
License Gate reads what is physically installed via @npmcli/arborist and compares each package’s license string verbatim against your allowlist. Apache 2.0 is not Apache-2.0. It does not guess, infer, or normalise.
Overrides live in licenses/allowed-packages.txt. They are allowed, but every
matched override is surfaced in the report as matchedPackageRule — never a silent
exclude.
Quick start
Run it after npm ci. Unknown or unapproved license strings fail the build.
npm install -D @mirasen/license-gate
mkdir -p licenses
echo "MIT" > licenses/allowed-hard.txt
npx license-gate check
Requires Node.js ≥ 22.9.0.
See the README for the full command reference.
How it works
License Gate reads the installed dependency graph via @npmcli/arborist. Each package’s
license string is checked verbatim against licenses/allowed-hard.txt. SPDX
expressions are parsed only to enumerate leaves, and each leaf is then checked literally
— everything not explicitly allowed is a violation. Packages whose license cannot be
determined need an explicit entry in licenses/allowed-packages.txt, and
every matched override stays visible in the report as matchedPackageRule.
Install @mirasen/license-gate as a dev dependency.
Add licenses/allowed-hard.txt with one license per line.
Run license-gate check after npm ci.
Scope boundaries
These are intentional boundaries, not gaps. Strictness is the point.
LICENSE, COPYING, and README are never opened.
Apache 2.0 is not the same as Apache-2.0.
--cwd is the only way to change the project root.
Every package the gate considered is accounted for in the report.
The tool is intentionally scoped to npm-installed graphs. pnpm, yarn, Gradle, and Maven are out of scope.
Links
Install the package from npm, review the README for the full command reference, or inspect the repository before adding it to CI.