1. Home
  2. Developer tools
  3. package.json Analyzer

package.json Analyzer

Review a project’s package.json before installing it, or tidy your own before publishing, without running npm.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use package.json Analyzer

  1. Paste or open package.json.
  2. Read the issues, then the dependency and script tables.
  3. Fix the file and paste it again to recheck.

Features

  • Unpinned (*, latest), open-ended and exact ranges explained
  • Caret on 0.x versions explained
  • Packages in both dependencies and devDependencies
  • Install, postinstall and prepare scripts that use curl, wget or eval
  • Package name, semver, license, engines and type checks

Supported formats

You can open

  • JSON

You get

  • Screen view

Private by design

Your files are opened and processed by your browser on this device. They are never uploaded to openWorkstand or anyone else, so the package.json Analyzer is safe for contracts, IDs, photos and work documents. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Does not contact the npm registry, so it cannot report outdated versions or known vulnerabilities.

Guide

Reviewing a package.json: version ranges, dependencies and scripts

A package.json file decides which code ends up in a JavaScript project and which commands run when someone installs it. Small details in it, an unpinned version here, a postinstall script there, have caused broken builds and real supply-chain attacks. This analyzer reads the file and points out the entries worth a second look, without running npm or contacting any registry.

Version ranges

npm uses semantic version ranges. ^18.3.1 accepts any 18.x release from 18.3.1 upward, ~5.6.3 only 5.6.x patches, and 5.6.3 exactly that version. The analyzer notes ranges that deserve attention: *, latest or an empty string let any version install, including a future major release that breaks your code; open-ended ranges such as >=2 have the same problem; and a caret on a 0.x version allows only patch updates, which surprises people who expect minor updates.

Where packages come from

Dependencies can also point at a Git repository, a GitHub shorthand, a URL or a local path. Those bypass the registry’s immutable versions, so the code behind them can change without the version number changing. They are noted, so you can decide whether to pin a commit or publish the package properly.

Dependency groups

dependencies are installed in production; devDependencies only during development. Build tools, type definitions, test runners and linters, such as TypeScript, Vite, Vitest or ESLint, normally belong in the second group, and the analyzer suggests moving them when it finds them in the first. A package listed in both groups is flagged, because only one entry wins and the duplicate hides which one.

Scripts that run on install

npm runs preinstall, install, postinstall and prepare automatically, which means a package can execute code on a developer’s machine or in CI just by being installed. Every script is listed, and those that run on install are marked. Scripts that download or evaluate code, with tools such as curl, wget, eval or base64 decoding, are flagged; when such a script runs on install, it is reported as an error because that is the pattern used in many malicious packages.

A worked example

The Sample package.json produces five checks. The postinstall script pipes a downloaded shell script into bash, which is reported as an error. react appears in both dependencies and devDependencies. lodash uses * and vitest uses latest, both flagged as unpinned, and typescript sits in dependencies, marked as usually a devDependency. In the dependency table, my-utils also carries a note that it installs from GitHub rather than the registry.

Metadata checks

The analyzer checks that the name follows npm’s rules: lower case, URL-safe characters and at most 214 characters. It checks that the version is valid semver, that public packages declare a license and repository, and suggests engines.node and an explicit type so tools know which Node versions and module system the project expects.

What an offline review cannot tell you

It does not know whether newer versions exist, whether a version has known vulnerabilities, or what the installed dependency tree looks like. Run npm outdated, npm audit and npm ls for those, and review the lockfile in pull requests.

Checked against the current version of the package.json Analyzer on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

What is the difference between ~ and ^ in a version range?

A tilde allows patch updates only: ~5.6.3 accepts 5.6.4 but not 5.7.0. A caret allows minor and patch updates within the same major version: ^5.6.3 accepts 5.7.0 but not 6.0.0. npm install writes carets by default.

When should a package be a peerDependency?

When your library plugs into something the application must provide exactly once, such as React for a component library or ESLint for a plugin. Listing it as a peer avoids installing a second copy that would not share state with the app’s own.

What does ^1.4.2 allow?

Any 1.x version from 1.4.2 up, but not 2.0.0. For 0.x versions the caret is stricter: ^0.4.2 allows only 0.4.x, because before 1.0 a minor release may break compatibility.

Why are install scripts flagged?

npm runs preinstall, install, postinstall and prepare automatically, so a compromised package can run code on your machine just by being installed. Scripts that download and execute code are worth reading first; npm install --ignore-scripts skips them.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.