changelog2obj

Parse changelog to object

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
changelog2obj
0.1.17 years ago7 years agoMinified + gzip package size for changelog2obj in KB

Readme

changelog2obj
Test coverage Build Status Dependency Status devDependency Status NPM version node License npm download
Parse changelog to object

Installation

$ npm install --save changelog2obj

Usage

const parser = require('changelog2obj');
const content = `
# changelog-test
## a.b.c

- alsdfasdf
- asdfasdf

## 0.0.3
- __change 3.1__
- **change 3.2**

## 0.0.2
- change 2.1
- _change 2.2_

## 0.0.1
- [change 1.1](./asdf)
- change 1.2
`;

parser(content);
/*
[{
  version: '0.0.3',
  changes: ['change 3.1', 'change 3.2']
}, {
  version: '0.0.2',
  changes: ['change 2.1', 'change 2.2']
}, {
  version: '0.0.1',
  changes: ['change 1.1', 'change 1.2']
}]
*/

objectify

parser.objectify(content);
/*
{
  '0.0.3': ['change 3.1', 'change 3.2'],
  '0.0.2': ['change 2.1', 'change 2.2'],
  '0.0.1': ['change 1.1', 'change 1.2']
}
*/

filter

parser(content, '>=0.0.2');
/*
[{
  version: '0.0.3',
  changes: ['change 3.1', 'change 3.2']
}, {
  version: '0.0.2',
  changes: ['change 2.1', 'change 2.2']
}]
*/

parser.objectify(content, '>=0.0.2');
/*
{
  '0.0.3': ['change 3.1', 'change 3.2'],
  '0.0.2': ['change 2.1', 'change 2.2']
}
*/

Test

$ npm run test
$ npm run test-cov
$ npm run test-travis

License

The MIT License (MIT)
Copyright (c) 2015 LingyuCoder
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.