{"id":20596039,"url":"https://github.com/davidfig/json-bump","last_synced_at":"2025-07-11T00:04:56.551Z","repository":{"id":23986871,"uuid":"100326001","full_name":"davidfig/json-bump","owner":"davidfig","description":"bumps the \"version\" entry for a JSON file","archived":false,"fork":false,"pushed_at":"2022-06-12T14:04:40.000Z","size":16,"stargazers_count":2,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T08:04:13.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidfig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-15T01:41:41.000Z","updated_at":"2020-10-04T05:21:38.000Z","dependencies_parsed_at":"2022-08-18T02:41:00.992Z","dependency_job_id":null,"html_url":"https://github.com/davidfig/json-bump","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/davidfig/json-bump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fjson-bump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fjson-bump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fjson-bump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fjson-bump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidfig","download_url":"https://codeload.github.com/davidfig/json-bump/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fjson-bump/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264696170,"owners_count":23650933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T08:14:52.478Z","updated_at":"2025-07-11T00:04:56.522Z","avatar_url":"https://github.com/davidfig.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-bump\nbumps the \"version\" entry for a JSON file\n\n## Version 1.0.0 note\nWith version 1.0.0, the node.js version returns a promise. Use async/await to ensure package.json gets properly written.\n\n## rationale\n\nAn easy to use component to bump the [semver](http://semver.org/) version of a JSON file. Includes both an exported package and a CLI.\n\n## installation\n\n    npm i json-bump\n\n## programmatic example\n```js\nconst bump = require('json-bump')\n\nasync function update() {\n    await bump('package.json', { replace: '1.0.1' })\n}\nupdate()\n```\n\n## command-line example\n\n    $ json-bump package.json\n    Updated package.json version from 0.1.2 to 0.1.3\n\n    $ json-bump data.json --minor\n    Updated data.json version from 1.0.5 to 1.1.0\n\n    $ json-bump\n\n    Usage: json-bump FILENAME [FLAGS]\n    Bumps the version in a json file using semver (MAJOR.MINOR.PATCH)\n\n    --replace=semver   this replaces the entire semver with the given string\n\n    --major=1          increment the major version (increments by 1 if flagged but not specified)\n    --minor=1          increment the minor version (increments by 1 if flagged but not specified)\n    --patch=1          increment the patch version (increments by 1 if flagged but not specified)\n    --entry=name       change entry updated (defaults is \"version\")\n    --spaces=4          number of spaces to format the .json file (set to 0 to remove spaces)\n\n    If no FLAGS are specified, increments PATCH by 1\n\n## API\n\n### async function version(filename, options)\nbumps the \"version\" entry for a .json file\n- {string} filename\n- {object} [options] defaults to incrementing PATCH by 1 if no options are provided\n- {string=\"version\"} [entry] name of entry to change\n- {number} [major] increment major by number (resetting MINOR and PATCH to 0)\n- {number} [minor] increment minor by number (resetting PATCH to 0)\n- {number} [patch] increment patch by number\n- {string} [replace] replace entry with this string\n- {number} [spaces=4] number of spaces to format the .json file (set to 0 to remove spaces)\n- returns: { updated: string, original: string, major: number, minor: number, patch: number }\n\n## license\nMIT License\n(c) 2020 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](https://twitter.com/yopey_yopey/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfig%2Fjson-bump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidfig%2Fjson-bump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfig%2Fjson-bump/lists"}