Versioning & Packages

package.json editor

Edit one manifest, inspect field errors, and sort dependency groups without changing scripts or conditional exports.

package.json editor

Manifest input

Formatted result

Your manifest stays in this browser. No registry lookup or script execution.

Field notes and limits

name identifies the package. New-package naming rules apply; it is optional for local projects.

Checks bundled manifest rules, names and root version. External tool configurations are preserved without their own validation.

One object; 100,000 UTF-16 units, depth 100. Unsafe integers and overflow are rejected. Dependency specifiers are only checked as strings.

Dependency groups

dependencies: 0 · devDependencies: 0 · peerDependencies: 0 · optionalDependencies: 0

No dependency entries to show.

Input or options changed. Check again before exporting.

A package.json editor is useful when a merge leaves a manifest difficult to review. A JSON parser can accept the file while a dependency value or a package name still needs attention.

Start with the private-project example. Compare the four dependency groups before sorting, then inspect the result without changing the original input.

Why use this package.json editor?

Keep meaningful order intact

This package.json editor sorts names inside dependencies, devDependencies, peerDependencies and optionalDependencies only. It leaves scripts, top-level fields and exports conditions in their original order, so a tidy diff does not silently change condition priority.

Four dependency groups reorder internally while neighboring export branches remain fixed.

Review a replacement before applying it

The result is a separate preview. Applying it, loading an example or clearing input shows the replacement size first. One undo restores the previous input and result together, including an invalid or outdated result.

An original manifest, a separate preview and return arrows showing application and undo.

Review changes without losing your starting point

01

Switch to deliberate checks

Auto checking waits 350 ms after an edit. Turn it off to reveal Validate and format; Ctrl or Cmd plus Enter runs the same check. Changing input or indentation immediately disables stale exports.

02

Preview dependency order

Sort dependencies previews all four groups. The group count reports how many maps actually changed order. Switch back to original order to format the unchanged source; neither action upgrades a version.

03

Apply only after comparing

Copy and download use the valid result, even before application. Apply result opens a replacement preview. After confirmation, Undo restores the earlier source and result, rather than trying to reverse individual text edits.

Inspect the manifest at three levels

Syntax before structure

The package.json validator rejects comments, trailing commas, duplicate keys and non-object roots. Diagnostics retain the original line, column and JSON Pointer, including keys with slashes.

Names and root versions

npm package name validation uses new-package rules for name and historical-name rules for dependency keys. A present version must parse with node-semver; absent name and version remain acceptable for a local project.

Readable groups and field notes

Inspect each package name and unchanged dependency specifier in its own group. Long lists show 100 rows at a time. Field notes explain runtime, development, peer and optional dependencies instead of merging them.

Formatting with a narrow sorting scope

Use the package.json formatter with two spaces, four spaces or tabs. To sort package.json dependencies, select the dedicated preview. Custom fields and numeric spelling survive formatting; the file downloads as package.json.

What a successful check does and does not establish

Local schema coverage
The bundled SchemaStore-derived schema checks manifest structure, with private restricted to a boolean. ESLint, Prettier and other external tool configurations are preserved without their own schema checks. The input’s $schema never initiates a fetch.
No installation or registry verdict
Dependency values are checked as strings. Tags, ranges, Git URLs, file paths, aliases and workspace specifiers stay unchanged; installability, version existence, newest versions and vulnerability status are not checked.
No command execution
Scripts are text values. The tool never executes a script, installs dependencies, publishes a package, updates a lockfile or resolves other workspace files. It does not certify publication readiness.
Ordering stays within four maps
Sorting cannot move a dependency between groups, remove duplicates across groups or rearrange exports/imports conditions. Array order, scripts and all other object order are retained. Strings may be re-escaped during formatting.
Bounded, strict input
Paste one JSON object, up to 100,000 UTF-16 code units and 100 levels deep. Unsafe integers and overflowing numbers block output. At most 50 diagnostics are shown; a failing or outdated result cannot be copied or downloaded.

package.json editor questions

Can I add comments to package.json?

Standard JSON does not allow // or block comments. This tool rejects them rather than stripping them automatically. If you use a custom metadata field for notes, it remains ordinary data; check that your own tooling accepts that convention.

How do dependencies, devDependencies and peerDependencies differ?

dependencies describes runtime packages; devDependencies is for development and testing; peerDependencies describes compatibility expected from a consuming project. optionalDependencies permits installation failure. The tool preserves every group and does not decide where a package belongs.

Can I alphabetize dependencies without installing a package?

Yes. The sorting preview orders names inside the four dependency maps in the browser. No npm package is installed. Review the changed-group count and download the result; scripts and conditional exports keep their order.

Why does the package name fail a naming-pattern check?

New names must satisfy npm’s rules, including lowercase and URL-friendly spelling and a total length of at most 214 characters. Scoped names such as @team/widget are supported. A valid spelling says nothing about registry availability or ownership.

What is the difference between ~ and ^ in package.json?

For ordinary nonzero major versions, ~1.2.3 generally allows patch updates while ^1.2.3 allows compatible minor updates too. Zero-major and prerelease ranges have additional rules. This tool preserves the range string and does not resolve an installed version.

Which fields does a minimal package.json need?

For a project that will not be published, npm permits omitted name and version, so an empty object passes this local structural check. Publication requires additional metadata and context. This page does not turn a passing local check into permission to publish.

Missing a useful manifest check?

Review your next manifest change

Open the package.json editor with a small example, inspect the dependency groups and keep the original input until you are ready to apply the result.