How to use the standard-changelog.createIfMissing function in standard-changelog

To help you get started, we’ve selected a few standard-changelog 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 algolia / shipjs / packages / shipjs-cli / src / util / generateChangelog.js View on Github external
const releaseCount = options.firstRelease ? 0 : options.releaseCount;

    const outputError = err => {
      if (options.verbose) {
        consoleError(grey(err.stack));
      } else {
        consoleError(error(err.toString()));
      }
      process.exit(1); // eslint-disable-line no-process-exit
    };

    const changelogStream = standardChangelog(options, undefined, {}).on(
      'error',
      outputError
    );
    standardChangelog.createIfMissing(infile);

    let readStream = null;
    if (releaseCount !== 0) {
      readStream = fs.createReadStream(infile).on('error', outputError);
    } else {
      readStream = new Readable();
      readStream.push(null);
    }

    if (options.append) {
      changelogStream
        .pipe(
          fs.createWriteStream(options.outfile, {
            flags: 'a',
          })
        )

standard-changelog

Generate a changelog from git metadata with Angular commit convention.

ISC
Latest version published 8 months ago

Package Health Score

80 / 100
Full package analysis