hatch-nodejs-version
Hatch plugin for versioning from a package.json file
What it is and what it does
This is a Hatch build plugin that bridges Python and Node.js packaging by reading version and metadata from a package.json file instead of requiring them to be duplicated in pyproject.toml. It provides two plugins: a version-source plugin that treats package.json as the single source of truth for version numbers, and a metadata-hook plugin that populates Python package metadata (author, description, URLs) from corresponding fields in package.json.
The plugin is designed for projects that maintain both Python and Node.js distributions or that want to keep version information in a single place. It handles conversion between semantic versioning (used by Node.js) and PEP 440 (Python's versioning standard), accepting only the common subset: major, minor, patch, pre-release, and dev-release components. The version-source plugin supports round-trip consistency, meaning versions can be read from and written back to package.json without loss of information, provided delimiters are chosen carefully.
Use it for:
- Maintain a single version number in package.json for a project that publishes both Python and Node.js packages.
- Automatically populate Python package metadata (author, repository, homepage) from an existing package.json without manual duplication.
- Ensure version consistency across Python and Node.js distributions during CI/CD builds.
- Migrate a Node.js project to Python packaging while keeping version management in the familiar package.json format.
- Use package.json as the canonical metadata source for monorepo or polyglot projects.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Hatch plugins to read and write Python package version and metadata from a Node.js package.json file, enabling version-source and metadata-hook integration.
Yes, if you maintain both Python and Node.js distributions or want to keep version and metadata in package.json as a single source of truth. The plugin has low install friction, permissive licensing, and no known vulnerabilities. The aging maintenance status (386 days since last release) is not a blocker—the package is stable and the repository remains active—but verify that your version format and metadata fields align with the plugin's supported subset before adopting it.
Install
hatch-nodejs-version on PyPI
pip
pip install hatch-nodejs-versionuv
uv add hatch-nodejs-versionpoetry
poetry add hatch-nodejs-versionInstalling hatch-nodejs-version
Before you install
Low install friction with a single runtime dependency on hatchling. The package is aging (386 days since last release) but remains actively maintained with recent commits; supports current Python versions 3.9–3.13.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
# Add to pyproject.toml
[build-system]
requires = ["hatchling", "hatch-nodejs-version"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "nodejs"
# Then hatch reads version from package.json automatically during build
Requires a package.json file in the project root (or at a configured path) with a version field; only accepts semver versions compatible with PEP 440 (major.minor.patch[-pre-release][-dev-release]).
Verify before relying
- Whether the metadata hook correctly handles all PEP 621 fields when reading from package.json, or only a subset.
- Performance impact of metadata hook on build time for large package.json files.
- Compatibility with monorepo setups where package.json may be in a non-standard location.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — hatchling |
| Maintenance | aging — 386 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 204,900/month — #9,598 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hatch_nodejs_version-0.4.0-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
hatch-vcsA Hatch plugin that automatically determines…
permissive · top 1,000 on PyPI
hatch-requirements-txtA Hatchling plugin that reads project…
permissive · top 5,000 on PyPI
hatch-regex-commitA Hatch plugin that automatically creates Git…
permissive · top 15,000 on PyPI
hatch-fancy-pypi-readmeA Hatch plugin that generates dynamic PyPI…
permissive · top 5,000 on PyPI
hatchling-autoextras-hookA Hatchling metadata hook that automatically…
permissive · top 5,000 on PyPI
versioningitAutomatically determines your Python package's…
permissive · top 5,000 on PyPI
hatch-jupyter-builderA Hatch build hook plugin that automates the…
permissive · top 15,000 on PyPI
hatchHatch is a modern Python project manager that…
permissive · top 1,000 on PyPI
httptoolshttptools provides Python bindings for parsing…
permissive · top 1,000 on PyPI