
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
ionic-version
Advanced tools
Seamlessly shadows the behaviour of npm version.
npm install ionic-version --save-dev
# or
yarn add ionic-version --dev
Hook into the "version" or "postversion" npm script in your app's package.json:
{
"name": "myApp",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
+ "postversion": "ionic-version"
},
// ...
}
Before you publish a new build of your app, run npm version <newversion>.
ionic-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.
npm install -g ionic-version
# or
yarn global add ionic-version
cd myApp/
npm version patch
ionic-version
-V, --version output the version number
-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.
--skip-tag For use with "--amend", if you don't want to update Git tags.
-A, --never-amend Never amend the previous commit.
-q, --quiet Be quiet, only report errors.
-h, --help output usage information
You 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:
{
// ...
"scripts": {
"postversion": "ionic-version --never-amend"
},
// ...
}
import version from "ionic-version";
async function doSomething() {
const versionResult = await version({
amend: true
// ...
});
}
// or
version({
amend: true
// ...
})
.then(commitHash => {
console.log(commitHash);
})
.catch(err => {
console.error(err);
});
Promise.<(string|Error)>Versions your app
Custom type definition for Promises
Promise.<(string|Error)>Versions your app
Kind: global function
Returns: Promise.<(string|Error)> - A promise which resolves with the last commit hash
| Param | Type | Description |
|---|---|---|
| program | Object | commander/CLI-style options, camelCased |
| projectPath | string | Path to your Ionic project |
Custom type definition for Promises
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| result | * | See the implementing function for the resolve type and description |
| result | Error | Rejection error object |
FAQs
Version your Ionic app in a `npm version` fashion.
The npm package ionic-version receives a total of 43 weekly downloads. As such, ionic-version popularity was classified as not popular.
We found that ionic-version demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.