{"id":15021085,"url":"https://github.com/stovmascript/ionic-version","last_synced_at":"2025-10-16T04:14:32.601Z","repository":{"id":25979833,"uuid":"104934748","full_name":"stovmascript/ionic-version","owner":"stovmascript","description":":1234: Version your Ionic app in a `npm version` fashion.","archived":false,"fork":false,"pushed_at":"2025-07-12T22:25:17.000Z","size":637,"stargazers_count":3,"open_issues_count":26,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-13T00:23:33.023Z","etag":null,"topics":["ionic","npm-version","semantic-versioning","semver"],"latest_commit_sha":null,"homepage":"","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/stovmascript.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-09-26T20:32:08.000Z","updated_at":"2022-05-20T05:06:44.000Z","dependencies_parsed_at":"2023-11-28T05:23:05.024Z","dependency_job_id":"3a9505e0-a250-4ee6-818e-459cde94191f","html_url":"https://github.com/stovmascript/ionic-version","commit_stats":{"total_commits":72,"total_committers":4,"mean_commits":18.0,"dds":0.3055555555555556,"last_synced_commit":"0f4e7521fa56ad560fbff669b59b108c27f85c2e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/stovmascript/ionic-version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stovmascript%2Fionic-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stovmascript%2Fionic-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stovmascript%2Fionic-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stovmascript%2Fionic-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stovmascript","download_url":"https://codeload.github.com/stovmascript/ionic-version/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stovmascript%2Fionic-version/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265076117,"owners_count":23707513,"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":["ionic","npm-version","semantic-versioning","semver"],"created_at":"2024-09-24T19:56:07.019Z","updated_at":"2025-10-16T04:14:27.562Z","avatar_url":"https://github.com/stovmascript.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ionic-version [![Build Status](https://travis-ci.org/stovmascript/ionic-version.svg?branch=master)](https://travis-ci.org/stovmascript/ionic-version)\n\nSeamlessly shadows the behaviour of [`npm version`](https://docs.npmjs.com/cli/version).\n\n## npm-scripts hook (automatic method)\n\n### Setup\n\n```bash\nnpm install ionic-version --save-dev\n# or\nyarn add ionic-version --dev\n```\n\nHook into the \"version\" or \"postversion\" npm script in your app's package.json:\n\n```diff\n{\n\t\"name\": \"myApp\",\n\t\"version\": \"0.0.1\",\n\t\"author\": \"Ionic Framework\",\n\t\"homepage\": \"http://ionicframework.com/\",\n\t\"private\": true,\n\t\"scripts\": {\n\t\t\"clean\": \"ionic-app-scripts clean\",\n\t\t\"build\": \"ionic-app-scripts build\",\n\t\t\"lint\": \"ionic-app-scripts lint\",\n\t\t\"ionic:build\": \"ionic-app-scripts build\",\n\t\t\"ionic:serve\": \"ionic-app-scripts serve\",\n+\t\t\"postversion\": \"ionic-version\"\n\t},\n\t// ...\n}\n```\n\n### Usage\n\nBefore you publish a new build of your app, run `npm version \u003cnewversion\u003e`.\n\nionic-version will then update your `config.xml` and therefore your `platforms/` code during build. Depending on the script and options you choose, it can also automatically amend the version bump commit and update the Git tag created by `npm version`. This method should be useful in most cases. If you need more control, take a look at the CLI and options below.\n\n## CLI\n\n### Setup\n\n```bash\nnpm install -g ionic-version\n# or\nyarn global add ionic-version\n```\n\n### Example usage\n\n```bash\ncd myApp/\nnpm version patch\nionic-version\n```\n\n## Options\n\n\u003c!-- START cli --\u003e\n\n    -V, --version      output the version number\n    -a, --amend        Amend the previous commit. Also updates the latest Git tag to point to the amended commit. This is done automatically when ionic-version is run from the \"version\" or \"postversion\" npm script. Use \"--never-amend\" if you never want to amend.\n    --skip-tag         For use with \"--amend\", if you don't want to update Git tags.\n    -A, --never-amend  Never amend the previous commit.\n    -q, --quiet        Be quiet, only report errors.\n    -h, --help         output usage information\n\n\u003c!-- END cli --\u003e\n\nYou can apply these options to the \"version\" or \"postversion\" script too. If for example you want to commit the changes made by ionic-version yourself, add the \"--never-amend\" option:\n\n```javascript\n{\n\t// ...\n\t\"scripts\": {\n\t\t\"postversion\": \"ionic-version --never-amend\"\n\t},\n\t// ...\n}\n```\n\n## API\n\n```javascript\nimport version from \"ionic-version\";\n\nasync function doSomething() {\n\tconst versionResult = await version({\n\t\tamend: true\n\t\t// ...\n\t});\n}\n\n// or\n\nversion({\n\tamend: true\n\t// ...\n})\n\t.then(commitHash =\u003e {\n\t\tconsole.log(commitHash);\n\t})\n\t.catch(err =\u003e {\n\t\tconsole.error(err);\n\t});\n```\n\n\u003c!-- START api --\u003e\n\n### Functions\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#version\"\u003eversion(program, projectPath)\u003c/a\u003e ⇒ \u003ccode\u003ePromise.\u0026lt;(string|Error)\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eVersions your app\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n### Typedefs\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#Promise\"\u003ePromise\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eCustom type definition for Promises\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"version\"\u003e\u003c/a\u003e\n\n### version(program, projectPath) ⇒ \u003ccode\u003ePromise.\u0026lt;(string\\|Error)\u0026gt;\u003c/code\u003e\n\nVersions your app\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003ePromise.\u0026lt;(string\\|Error)\u0026gt;\u003c/code\u003e - A promise which resolves with the last commit hash\n\n| Param       | Type                | Description                             |\n| ----------- | ------------------- | --------------------------------------- |\n| program     | \u003ccode\u003eObject\u003c/code\u003e | commander/CLI-style options, camelCased |\n| projectPath | \u003ccode\u003estring\u003c/code\u003e | Path to your Ionic project              |\n\n\u003ca name=\"Promise\"\u003e\u003c/a\u003e\n\n### Promise\n\nCustom type definition for Promises\n\n**Kind**: global typedef  \n**Properties**\n\n| Name   | Type               | Description                                                        |\n| ------ | ------------------ | ------------------------------------------------------------------ |\n| result | \u003ccode\u003e\\*\u003c/code\u003e    | See the implementing function for the resolve type and description |\n| result | \u003ccode\u003eError\u003c/code\u003e | Rejection error object                                             |\n\n\u003c!-- END api --\u003e\n\n## See also\n\n* [npm-version](https://docs.npmjs.com/cli/version)\n* [Semantic Versioning (semver)](http://semver.org/)\n* [react-native-version](https://github.com/stovmascript/react-native-version)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstovmascript%2Fionic-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstovmascript%2Fionic-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstovmascript%2Fionic-version/lists"}