npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ezchangelog

v6.0.0

Published

changelog

Downloads

794

Readme

ezchangelog

version status coverage dependencies devDependencies

Make it easy to update changelog with commit messages.

Usage

npm i -g ezchangelog

cd repo

# create a new changelog.md file
changelog

# do some commits

# prepend new changes use `git log --no-merges`
changelog

# prepend new changes
git log --before Nov.10 | changelog

Example

See changelog

Command line

changelog -h to see options.

There are two ways in the command line.

The following command will call git log --no-merges to generate changes info:

changelog [options]

You can also pipe the changes into it:

git log --before Nov.10 | changelog [options]

package.json

{
  "changelog": {
    "baseUrl": "https://github.com/zoubin/ezchangelog/commit/",
    "plugin": ["pluginName"],
    "out": "changelog.md"
  }
}

There are links to all commits.

baseUrl: specify the base path for each commit. By default, commits are linked to github.

out: specify the changelog file path

API

var changelog = require('ezchangelog')

changelog(opts)

Return a transform to process git log outputs.

opts.baseUrl

Specify the url base for commits.

Type: String

opts.plugin

Specify extra plugins to apply to the pipeline.

Type: Array

Each element should be an Array, if the plugin should take an extra argument besides the Changelog instance.

{
  plugin: [ [function pluginFn(instance, opt) {}, opt] ]
}

changelog.Changelog

The constructor for loggers.

You can process the pipeline property and the plugin function.

pipeline

A duplex created by labeled-stream-splicer, assembling a group of transforms to process the log.

There are two main phases:

  • parse: containing sub-phases: split, commit, tag, url. The main purpose of this phase is to create commit objects.
  • format: containing one sub-phase: markdownify. Commit objects are formatted to markdown in this phase.

The default commit object is like:

{
  commit: {
    // commit sha1
    long: '3bf9055b732cc23a9c14f295ff91f48aed5ef31a',
    short: '3bf9055',
  },
  committer: {
    // commit date
    date: new Date('Sat Nov 7 18:41:37 2015 +0800'),
  },
  // raw message lines
  messages: ['', '    4.0.3', ''],
  // raw headers before the messages
  headers: [
    ['Author', 'zoubin <[email protected]>'],
    ['Date', 'Sat Nov 7 18:41:37 2015 +0800'],
  ],
  // the first non-empty message line
  subject: '4.0.3',
  // other message lines
  body: '',
  // git tag
  tag: 'v4.0.3',
  // link to the commit. opts.baseUrl should be specified.
  url: 'https://github.com/zoubin/ezchangelog/commit/3bf9055',
}

You can manipulate the pipeline in the way labeled-stream-splicer supports.

plugin

Type: Array

Each element is a plugin with optional argument.

A plugin is used to manipulate the pipeline property:

var Changelog = require('ezchangelog').Changelog
var c = new Changelog()
c.plugin(fn)

source.pipe(c.pipeline).pipe(dest)

funciton fn(c, opts) {
  // parse emails
  c.pipeline.get('parse').push(emailParser)

  // replace the default formatter with a custom one
  c.pipeline.get('format').splice('markdownify', 1, myOwesomeFormatter)
}