https://github.com/valeriobelli/changesets-changelog-entry
Get an entry from Changesets' changelog.
https://github.com/valeriobelli/changesets-changelog-entry
changelog changesets cli
Last synced: 3 days ago
JSON representation
Get an entry from Changesets' changelog.
- Host: GitHub
- URL: https://github.com/valeriobelli/changesets-changelog-entry
- Owner: valeriobelli
- License: mit
- Created: 2022-08-23T14:57:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-24T09:20:20.000Z (over 3 years ago)
- Last Synced: 2025-09-05T02:47:23.425Z (5 months ago)
- Topics: changelog, changesets, cli
- Language: TypeScript
- Homepage:
- Size: 893 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# changesets-changelog-entry
This library extracts the logic of internal functions of [https://github.com/changesets/action](https://github.com/changesets/action) to be consumed externally. It offers two ways of consumption:
- CLI
- library
## Installation
```bash
yarn add --dev changesets-changelog-entry
```
## Usage
### CLI
```bash
yarn changesets-changelog-entry ./pathname/to/changelog.md @megacorpinc/example-lib@1.0.0-evil
```
### Library
```javascript
const { getChangelogEntry, getChangelogEntryFromFile } = require('changesets-changelog-entry')
const changelog = `# @megacorpinc/example-lib
## 1.0.0-evil
### Major changes
- Destroy the earth
`
const entryFromStringContent = getChangelogEntry(changelog, '1.0.0-evil')
console.log(entryFromStringContent.content)
console.log(entryFromStringContent.highestLevel)
const entryFromFile = getChangelogEntryFromFile('./CHANGELOG.md', '1.0.0-evil')
console.log(entryFromFile.content)
console.log(entryFromFile.highestLevel)
```