How to use react-native-version - 1 common examples

To help you get started, we’ve selected a few react-native-version examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github staltz / manyverse / tools / update-version.js View on Github external
rl.question('Next version will be `' + nextVersion + '`, okay? y/n ', yn => {
  if (yn !== 'y' && yn !== 'Y') {
    console.log('Release cancelled.\n');
    process.exit(1);
    return;
  }

  const pkgJSON = JSON.parse(fs.readFileSync('./package.json'));
  const pkgLockJSON = JSON.parse(fs.readFileSync('./package-lock.json'));
  pkgJSON.version = nextVersion;
  pkgLockJSON.version = nextVersion;
  fs.writeFileSync('./package.json', JSON.stringify(pkgJSON, null, 2));
  fs.writeFileSync('./package-lock.json', JSON.stringify(pkgLockJSON, null, 2));

  ReactNativeVersion.version(
    {
      neverAmend: true,
      target: 'android',
    },
    path.resolve(__dirname, '../'),
  ).catch(err => {
    console.error(err);
    process.exit(1);
  });

  rl.close();
});

react-native-version

Version your React Native or Expo app in a `npm version` fashion.

MIT
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis

Popular react-native-version functions