# stringify-changelog

> Generate a markdown-formatted changelog from an object, array, yaml or json file.

Latest version **0.2.1** (published 2016-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install stringify-changelog
pnpm add stringify-changelog
yarn add stringify-changelog
bun add stringify-changelog
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2016-07-21 |
| First published | 2015-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | changelog, stringify |

## Links

- npm: https://www.npmjs.com/package/stringify-changelog
- Repository: https://github.com/jonschlinkert/stringify-changelog
- Issues: https://github.com/jonschlinkert/stringify-changelog/issues
- npm.io page: https://npm.io/package/stringify-changelog

## Dependencies (4)

- [moment](https://npm.io/package/moment.md) ^2.14.1
- [isobject](https://npm.io/package/isobject.md) ^2.1.0
- [js-yaml-lite](https://npm.io/package/js-yaml-lite.md) ^0.1.1
- [extend-shallow](https://npm.io/package/extend-shallow.md) ^2.0.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2016-07-21
- 0.2.0 — 2016-07-21
- 0.1.6 — 2016-07-21
- 0.1.5 — 2016-07-21
- 0.1.4 — 2016-07-21
- 0.1.3 — 2016-07-21
- 0.1.1 — 2015-08-01
- 0.1.0 — 2015-03-16

## README

# stringify-changelog [![NPM version](https://img.shields.io/npm/v/stringify-changelog.svg?style=flat)](https://www.npmjs.com/package/stringify-changelog) [![NPM downloads](https://img.shields.io/npm/dm/stringify-changelog.svg?style=flat)](https://npmjs.org/package/stringify-changelog) [![Build Status](https://img.shields.io/travis/jonschlinkert/stringify-changelog.svg?style=flat)](https://travis-ci.org/jonschlinkert/stringify-changelog)

Generate a markdown-formatted changelog from an object, array, yaml or json file.

Converts valid YAML, like this:

```yaml
v0.1.0:
  date: "2016-12-26"
  changed:
    - Got stuck in another chimney.
```

Into this:

```markdown
### [v0.1.0] - 2016-12-26

**changes**

- Got stuck in another chimney.
```

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save stringify-changelog
```

## Usage

```js
var changelog = require('stringify-changelog');
changelog(value, options);
```

**Params**

* `value` **{String|Object|Array}**: File path of YAML file to read, object or array of changes (see below)
* `options` **{Object}**: the following options may be passed to modify output
  - `format` **{Function}** Custom function for formatting each entry in the changelog
  - `key` **{Function}** Prepend the following key/reference to your generated changelog, to guide users in making semantically labeled entries.

**Example key**

```
## key

Changelog entries are classified using the following labels from [keep-a-changelog][]:

- `added`: for new features
- `changed`: for changes in existing functionality
- `deprecated`: for once-stable features removed in upcoming releases
- `removed`: for deprecated features removed in this release
- `fixed`: for any bug fixes

[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
```

## Data format

Conventions from [keep-a-changelog][] are supported by default. When data is passed as an object or array (from a file or directly), changelog entries can be categorized using the following labels as property names:

* `added` for new features.
* `changed` for changes in existing functionality.
* `deprecated` for once-stable features removed in upcoming releases.
* `removed` for deprecated features removed in this release.
* `fixed` for any bug fixes.
* `security` to invite users to upgrade in case of vulnerabilities.

### Examples

Data can either be formatted as an array or an object.

**Object**

JSON

```js
{ 'v0.1.0':
   { date: '2016-12-26',
     changed: [ 'Got stuck in another chimney.' ] } }
```

YAML

```yaml
v0.1.0:
  date: "2016-12-26"
  changed:
    - Got stuck in another chimney.
```

**Array**

JSON

```js
[ { date: '2016-12-26',
    version: 'v0.1.0',
    changed: [ 'Got stuck in another chimney.' ] } ]
```

YAML

```yaml
- version: v0.1.0
  date: '2016-12-26'
  changed:
    - Got stuck in another chimney.
```

### Arbitrary entries

If you don't want to follow keep-a-changelog format, or you have an arbitrary entry that doesn't fit in one of the above categories, you can use the `description` property.

**Array**

```js
[ { date: '2016-12-26',
    version: 'v0.1.0',
    description: [ 'Got stuck in another chimney.' ] } ]
```

**Object**

```js
{ 'v0.1.0':
   { date: '2016-12-26',
     description: [ 'Got stuck in another chimney.' ] } }
```

## About

### Related projects

[helper-changelog](https://www.npmjs.com/package/helper-changelog): Template helper for generating a markdown-formatted changelog from an object, array or yaml file. | [homepage](https://github.com/jonschlinkert/helper-changelog "Template helper for generating a markdown-formatted changelog from an object, array or yaml file.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

### License

Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/stringify-changelog/blob/master/LICENSE).

***

_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 21, 2016._

---
_Source: https://npm.io/package/stringify-changelog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
