package.json Linter & Analyzer
npm-specific findings for your manifest: names, exports, dependencies, scripts and publish readiness.
package.json
Findings
Awaiting manifestPaste a package.json to lint it
Try the broken-manifest example to see every rule category.
Details
Generic JSON formatters cannot tell a malformed npm manifest from a valid one. This linter encodes npm naming rules (lowercase, URL-safe characters, scoped names, reserved names, 214-character limit), publish metadata expectations, exports/main resolution precedence, dependency-map mistakes (duplicates, optional conflicts, exact peer pins, irreproducible ranges), script and legacy field checks, and publish-readiness signals such as private/publishConfig conflicts. Every finding carries a severity, JSONPath-style path, rationale and fix snippet. Range validation is built in — no registry or network calls, no installed-module scanning.
More examples
Invalid name
"name": "My Package" → ERROR: must be lowercase and URL-safenpm rejects uppercase letters and spaces in new package names.
exports vs main
"main": "./index.js" + "exports": {"./feature": ...} → WARN: exports has no "." entryNode ignores main when exports exists, so consumers lose the root import.
Duplicate dependency
debug in dependencies and devDependencies → WARN; also in optionalDependencies → ERRORConflicting dependency classifications make installs hard to reason about.
Examples
Invalid name
"name": "My Package"ERROR: lowercase and URL-safe requirednpm rejects uppercase and spaces for new packages.
exports overrides main
main: ./index.js, exports: {"./feature": ...}WARN: exports has no "." entry and overrides mainModern Node resolution ignores main when exports is present.
Duplicate dependency
debug in dependencies + devDependenciesWARN with a removal suggestionThe production dependency wins; the dev entry is dead metadata.
About this tool
package.json Linter & Analyzer checks a pasted manifest against npm semantics, not just JSON syntax. It validates package names (lowercase, URL-safe, scoped names, reserved names, 214-character limit), version fields, registry metadata, entry-point consistency and dependency-map correctness.
Findings include an error, warning or info severity, a JSONPath-style location, a short rationale and a copyable fix. Entry-point checks cover exports without a "." entry, exports taking precedence over main, type: module with a .js main, and missing types declarations.
Dependency checks detect packages listed in both dependencies and devDependencies, conflicts with optionalDependencies, exact peer-dependency pins, unrecognised ranges and irreproducible latest/file/link ranges. Scripts, bin entries, legacy fields and publish-readiness flags are checked too.
The range checker is built in, so the tool is fully offline: no registry requests, no installed-module scanning and no manifest uploads.
What this tool does not do
- No registry access, vulnerability advisory matching or installed-node_modules inspection is performed.
- Range validation covers common semver forms and npm protocol specifiers, not every exotic edge case.
- File existence behind bin/main/types paths cannot be verified offline.
- Findings are advisory conventions; some private packages intentionally omit public metadata.
How to use this tool
Paste a manifest
Paste package.json into the editor or load the clean/broken example chips. Syntax errors include a line and column.
Review by severity
Filter errors, warnings and info; expand a finding for its rationale and copyable fix snippet.
Fix in place
Edit the manifest on the left — findings update immediately as you type.
Export a report
Copy or download the Markdown report to attach to a PR or publish checklist.
Use cases
First publish
Check a new package against npm conventions before npm publish.
Monorepo audits
Review each workspace manifest for inconsistent metadata and ranges.
Support triage
Diagnose install or publish failures caused by manifest mistakes.
Code review
Attach a lint report to a PR that changes package metadata.
Rule categories
| Category | Checks |
|---|---|
| Name | Lowercase, URL-safe, length, reserved names, scope validation |
| Fields | Version, description, license, repository, author, keywords, bugs, engines |
| Entry points | exports '.', main conflict, type: module, types field |
| Dependencies | Duplicates, optional conflicts, peer pins, range validity, unpinned ranges |
| Scripts / publish | test script, script types, bin paths, legacy fields, private + publishConfig, files and workspaces |
private: true suppresses publish-metadata findings for internal packages.
Common mistakes
Mistake:Assuming JSON validity means npm validity.
Fix:Generic validators do not know npm naming, exports precedence or dependency-map rules.
Mistake:Putting the same dependency in dependencies and devDependencies.
Fix:Keep it in dependencies only; the tool flags the duplicate.
Mistake:Pinning peerDependencies to an exact version.
Fix:Use a compatible range such as >=18 <20 to avoid consumer conflicts.
Mistake:Using latest or file: ranges for published packages.
Fix:Use a semver range so installs are reproducible.
Mistake:Expecting a vulnerability scan.
Fix:This tool checks manifest semantics only; advisories require a lockfile scanner.
Frequently asked questions
What characters are valid in an npm package name?
New names must be lowercase, URL-safe and at most 214 characters. Letters, digits, hyphens, dots and underscores are allowed; names cannot start with a dot or underscore, and reserved names such as node_modules and favicon.ico are rejected. Scoped names use @scope/name with both parts validated.
Why does exports override main?
When the exports field exists, Node's resolver consults it first and ignores main entirely. If you keep both, make sure exports has a "." entry pointing at the same file as main.
Should peerDependencies be exact versions?
Usually no. An exact pin makes conflicts likely; use a compatible range such as >=18 <20 or ^18.2.0 unless you have a specific reason to pin.
What belongs in files vs dependencies?
files is a publish allowlist of paths in your package; dependencies are runtime packages to install. When files exists, .npmignore is not used for the package contents.
Does it check my installed modules?
No. Only the pasted manifest is analyzed; there is no registry access and no node_modules scan, so no network request or local file read occurs.
Why are some findings marked info instead of warnings?
Info findings are conventional improvements (for example declaring engines or a test script), while warnings and errors describe mistakes likely to break installs or publishes.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.