{"_id":"@bigfootds/nodejs-semver-updater","_rev":"3-98185e2a79b4a07fa824f3a538587e8d","name":"@bigfootds/nodejs-semver-updater","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@bigfootds/nodejs-semver-updater","version":"0.0.1","keywords":["nodejs","node","npm","package-json","semver","version","cli"],"author":{"name":"BigfootDS"},"license":"MIT","_id":"@bigfootds/nodejs-semver-updater@0.0.1","maintainers":[{"name":"alexstormwood","email":"alex@bigfootds.com"}],"homepage":"https://github.com/BigfootDS/pkg-nodejs-semver-updater#readme","bugs":{"url":"https://github.com/BigfootDS/pkg-nodejs-semver-updater/issues"},"bin":{"nodejs-semver-updater":"dist/cli.js"},"dist":{"shasum":"f0f46101e9c71aac3268bd72ddae2c36b9202227","tarball":"https://registry.npmjs.org/@bigfootds/nodejs-semver-updater/-/nodejs-semver-updater-0.0.1.tgz","fileCount":19,"integrity":"sha512-KrA5jElUU2eiEV0F9A9c4kqDw9o0ilu0vkK8RshUgpe4ncYL8dlKwjlLerinmDnhbTJNJRQf8SHcuwzpx0x6VQ==","signatures":[{"sig":"MEUCIDh3lgcK6wkW/Q+x2TEfmCTuhPJn0Px5hjU3i2xqVoTFAiEA+4meIiKlVp/xfOQ9zRHAzQScmyRlXXwFzUcuwZKq0iw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35970},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"db0c7e60c62cb0ff59f66c973820d4143bf35afd","scripts":{"test":"npm run build && node --test test/*.test.js","build":"tsc --project tsconfig.json","prepack":"npm run build","pack:check":"npm pack --dry-run"},"_npmUser":{"name":"alexstormwood","email":"alex@bigfootds.com"},"repository":{"url":"git+https://github.com/BigfootDS/pkg-nodejs-semver-updater.git","type":"git"},"_npmVersion":"11.17.0","description":"Update a Node.js project's package version and related JSON version properties from Node.js or the command line.","directories":{},"_nodeVersion":"25.6.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^24.13.3"},"_npmOperationalInternal":{"tmp":"tmp/nodejs-semver-updater_0.0.1_1787800240107_0.5719681570015192","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@bigfootds/nodejs-semver-updater","version":"0.0.2","keywords":["nodejs","node","npm","package-json","semver","version","cli"],"author":{"name":"BigfootDS"},"license":"MIT","_id":"@bigfootds/nodejs-semver-updater@0.0.2","maintainers":[{"name":"alexstormwood","email":"alex@bigfootds.com"}],"homepage":"https://github.com/BigfootDS/pkg-nodejs-semver-updater#readme","bugs":{"url":"https://github.com/BigfootDS/pkg-nodejs-semver-updater/issues"},"bin":{"nodejs-semver-updater":"dist/cli.js"},"dist":{"shasum":"b668086d0ce0eacc0a947d58e7d53d3e0df9accc","tarball":"https://registry.npmjs.org/@bigfootds/nodejs-semver-updater/-/nodejs-semver-updater-0.0.2.tgz","fileCount":19,"integrity":"sha512-+q+P5QPhhYwZm7+Cb287Hi4SDcIrp5uRhCnTnkhVAcIJd7iVw1ZUls4ywWmWrj8whxKrynF+gfr+D926kEiPDQ==","signatures":[{"sig":"MEQCIGFiruAZqTrMCBuRZHF3s7YsDgTI+XMtvjVpI5L7IUKDAiA0T2/ZuLWgpCOYTh7F+TMIyxqZgn/IZgbO8geMZTN3hQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bigfootds%2fnodejs-semver-updater@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":35681},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"c9a6b58c313340c5f57dad985df78f0c5f1fe8f7","scripts":{"test":"npm run build && node --test test/*.test.js","build":"tsc --project tsconfig.json","prepack":"npm run build","pack:check":"npm pack --dry-run"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:92a90ba5-f504-4843-8e87-2d3241236f1e"}},"repository":{"url":"git+https://github.com/BigfootDS/pkg-nodejs-semver-updater.git","type":"git"},"_npmVersion":"11.17.0","description":"Update a Node.js project's package version and related JSON version properties from Node.js or the command line.","directories":{},"_nodeVersion":"24.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^24.13.3"},"_npmOperationalInternal":{"tmp":"tmp/nodejs-semver-updater_0.0.2_1787800519500_0.9667902220457163","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@bigfootds/nodejs-semver-updater","version":"0.1.0","description":"Update a Node.js project's package version and related JSON version properties from Node.js or the command line.","license":"MIT","author":{"name":"BigfootDS"},"scripts":{"build":"tsc --project tsconfig.json","test":"npm run build && node --test test/*.test.js","pack:check":"npm pack --dry-run","prepack":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/BigfootDS/pkg-nodejs-semver-updater.git"},"type":"commonjs","bugs":{"url":"https://github.com/BigfootDS/pkg-nodejs-semver-updater/issues"},"homepage":"https://github.com/BigfootDS/pkg-nodejs-semver-updater#readme","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js","default":"./dist/index.js"}},"bin":{"nodejs-semver-updater":"dist/cli.js"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"keywords":["nodejs","node","npm","package-json","semver","version","cli"],"devDependencies":{"@types/node":"^24.13.3","typescript":"^7.0.2"},"engines":{"node":">=20"},"gitHead":"cfdcecdf4753c07c552affcf5c21b8ee3ea39ff6","_id":"@bigfootds/nodejs-semver-updater@0.1.0","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-7hasUqu5CMYSO/z49UpDqtnWXPeCZ8s7ujpaMCmvY8Pj46RPJTqQRN/00HO0Tu7tDDX1qGZw9DtWqWfc/YWZmA==","shasum":"977322b1a7a851a2faa177729a6302a4e581147a","tarball":"https://registry.npmjs.org/@bigfootds/nodejs-semver-updater/-/nodejs-semver-updater-0.1.0.tgz","fileCount":19,"unpackedSize":36865,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bigfootds%2fnodejs-semver-updater@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC4xln+F/Yn7RdPreHOf5XBB8WAEtGYXuzcN0/u72LGHwIgcgqIeImR9mD+Ex6eqnCSpeII1DmQnkM+4+3PVx0jI04="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:92a90ba5-f504-4843-8e87-2d3241236f1e"}},"directories":{},"maintainers":[{"name":"alexstormwood","email":"alex@bigfootds.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nodejs-semver-updater_0.1.0_1787803258216_0.7433429920022276"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T03:10:39.878Z","modified":"2026-08-27T04:00:58.787Z","0.0.1":"2026-08-27T03:10:40.252Z","0.0.2":"2026-08-27T03:15:19.658Z","0.1.0":"2026-08-27T04:00:58.391Z"},"bugs":{"url":"https://github.com/BigfootDS/pkg-nodejs-semver-updater/issues"},"author":{"name":"BigfootDS"},"license":"MIT","homepage":"https://github.com/BigfootDS/pkg-nodejs-semver-updater#readme","keywords":["nodejs","node","npm","package-json","semver","version","cli"],"repository":{"type":"git","url":"git+https://github.com/BigfootDS/pkg-nodejs-semver-updater.git"},"description":"Update a Node.js project's package version and related JSON version properties from Node.js or the command line.","maintainers":[{"name":"alexstormwood","email":"alex@bigfootds.com"}],"readme":"# Node.js SemVer Updater\n\nUpdate a Node.js project's `package.json` version and any related JSON version fields from the command line or TypeScript. The package has no runtime dependencies and validates Semantic Versioning 2.0.0 itself.\n\n`package.json` is always updated. Use additional JSON properties when a project also keeps a version in its own JSON configuration file.\n\n## Install and run\n\nRun the CLI without adding it to your project:\n\n```sh\nnpx --yes @bigfootds/nodejs-semver-updater --version 1.2.3\n```\n\nBy default, this updates `./package.json`.\n\n```sh\nnpx --yes @bigfootds/nodejs-semver-updater \\\n  --package apps/desktop/package.json \\\n  --version 1.2.3\n```\n\n### Additional JSON version properties\n\nUse `--property <file-path>:<json-pointer>` once per additional version field. JSON Pointers follow [RFC 6901](https://www.rfc-editor.org/rfc/rfc6901), so nested properties use `/` separators.\n\n```sh\nnpx --yes @bigfootds/nodejs-semver-updater \\\n  --version 1.2.3 \\\n  --property electron-builder.json:/buildVersion \\\n  --property version-metadata.json:/release/version\n```\n\nThe command validates every target before writing any file. A configured property must already exist and contain a string, unless `--create-missing-properties` is supplied. That option can create only the final property in a path; its parent object must already exist.\n\n```sh\nnpx --yes @bigfootds/nodejs-semver-updater \\\n  --version 1.2.3 \\\n  --property version-metadata.json:/release/version \\\n  --create-missing-properties\n```\n\n### CLI options\n\n| Option | Description |\n| --- | --- |\n| `--version <version>` | Required target version. Must be valid SemVer unless `--allow-non-semver` is used. |\n| `--package <path>` | `package.json` to update. Defaults to `package.json`. |\n| `--property <file:pointer>` | Additional JSON version property. Repeat for each property. |\n| `--create-missing-properties` | Permit creation of the final configured JSON property. |\n| `--allow-non-semver` | Accept a custom version string, such as an internal build number. |\n| `--dry-run` | Validate and report changes without writing files. |\n| `--help` | Show command help. |\n\n## TypeScript API\n\n```ts\nimport { updateNodeProjectVersion } from \"@bigfootds/nodejs-semver-updater\";\n\nconst result = await updateNodeProjectVersion({\n  version: \"1.2.3\",\n  packagePath: \"apps/desktop/package.json\",\n  additionalVersionProperties: [\n    { filePath: \"electron-builder.json\", jsonPointer: \"/buildVersion\" },\n    { filePath: \"version-metadata.json\", jsonPointer: \"/release/version\" },\n  ],\n});\n\nconsole.log(result.changed);\n```\n\nSet `validateSemver: false` to accept version strings outside Semantic Versioning, and `dryRun: true` to inspect planned changes without writing them.\n\nAn additional property can instead receive its own exact string. This keeps npm's required SemVer value separate from a display version:\n\n```ts\nadditionalVersionProperties: [\n  { filePath: \"package.json\", jsonPointer: \"/gameVersion\", value: \"Game v1.2.3-beta\" },\n]\n```\n\n## Electron, Capacitor and native configuration\n\nFor standard Electron Builder projects, the app version comes from `package.json` by default, so no extra configuration is needed. See Electron Builder's [configuration reference](https://www.electron.build/configuration.html) for projects that override that default.\n\nSome Electron or Capacitor projects keep duplicate version strings in their own JSON configuration. Configure these with `additionalVersionProperties` or repeated `--property` options. This package intentionally does not modify JavaScript, TypeScript, YAML, XML, Gradle or plist files. Keep those values derived from `package.json`, update them with a platform-specific tool, or add an explicit workflow step for them.\n\n## GitHub Actions\n\nUse the CLI in a workflow after checking out the repository:\n\n```yaml\n- uses: actions/checkout@v6\n\n- uses: actions/setup-node@v6\n  with:\n    node-version: 20.x\n\n- run: npx --yes @bigfootds/nodejs-semver-updater --version 1.2.3\n```\n\nCommit the resulting project files in a later step if the workflow should retain the version bump.\n\n## Development\n\nRequires Node.js 20 or newer.\n\n```sh\nnpm ci\nnpm test\nnpm run pack:check\n```\n\nThe test suite covers the TypeScript API and the built CLI. The CI workflow verifies Node.js 20, 22 and 24.\n\n## Releases\n\nThe `cd.yml` workflow creates npm releases from conventional commits pushed to `main`.\n","readmeFilename":"README.md"}