lacspace-license
Generate, header & audit your project's licence.
npx lacspace-license init MITEverything, in one command
Most projects get their licensing right once and then let it rot — the year in the header ages, a new file ships with no notice, package.json says MIT while the LICENSE file says something else. lacspace-license makes licence hygiene a one-command, CI-enforceable step. It embeds the full canonical texts of 12 common licences (plus the Lacspace Free Licence), fills your name and year, understands the comment syntax of 60+ file types, and never corrupts a file — headers are idempotent, shebang-safe and preserve your line endings. It runs entirely on local files with no network and no telemetry.
What's inside
LICENSE generator
Filled from any SPDX id, author/year read from package.json.
Per-file headers
Correct //, #, --, /* */, <!-- --> syntax per language.
Idempotent & safe
Re-runs are no-ops; shebang, EOL and final newline preserved.
THIRD-PARTY-NOTICES
Grouped-by-licence md/txt from node_modules, --prod aware.
CI gate
check fails when LICENSE is missing, mismatched, or a header is absent.
Fuzzy detection
Identifies a LICENSE text tolerant of CRLF/whitespace.
Zero deps, offline
Full licence texts embedded; nothing leaves your machine.
Copy, paste, done
Real commands and snippets — from a one-liner to the typed library.
npx lacspace-license init MIT --author "Lacspace" --year 2026Author/year auto-read from package.json when omitted.
npx lacspace-license add "src/**/*.{ts,js}" --id MIT --writeIdempotent — running twice changes nothing.
npx lacspace-license add "src/**/*.ts" --dry-runSee what would change before writing.
npx lacspace-license notices --prod -o THIRD-PARTY-NOTICES.mdGrouped by licence, prod deps only.
npx lacspace-license check --require-headersExits non-zero on any violation.
What people build with it
✓ Ship a correct LICENSE in seconds
✓ Enforce licence headers across a monorepo in CI
✓ Keep copyright years current
✓ Produce attribution/notices for a release
Run lacspace-license today
Free, open-source, no API keys. It's a CLI and a typed library.
npx lacspace-license init MIT