Skip to content

Commit bc8da35

Browse files
committed
fix: rename to npm-fetch-changelog
1 parent 3af66aa commit bc8da35

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# what-broke
1+
# npm-fetch-changelog
22

3-
[![CircleCI](https://circleci.com/gh/jedwards1211/what-broke.svg?style=svg)](https://circleci.com/gh/jedwards1211/what-broke)
4-
[![Coverage Status](https://codecov.io/gh/jedwards1211/what-broke/branch/master/graph/badge.svg)](https://codecov.io/gh/jedwards1211/what-broke)
3+
[![CircleCI](https://circleci.com/gh/jedwards1211/npm-fetch-changelog.svg?style=svg)](https://circleci.com/gh/jedwards1211/npm-fetch-changelog)
4+
[![Coverage Status](https://codecov.io/gh/jedwards1211/npm-fetch-changelog/branch/master/graph/badge.svg)](https://codecov.io/gh/jedwards1211/npm-fetch-changelog)
55
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
66
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
7-
[![npm version](https://badge.fury.io/js/what-broke.svg)](https://badge.fury.io/js/what-broke)
7+
[![npm version](https://badge.fury.io/js/npm-fetch-changelog.svg)](https://badge.fury.io/js/npm-fetch-changelog)
88

9-
list breaking changes in newer major versions of packages
9+
fetch the changelog for an npm package from GitHub
1010

1111
# How it works
1212

13-
Right now only packages hosted on GitHub are supported. `what-broke` will get
13+
Right now only packages hosted on GitHub are supported. `npm-fetch-changelog` will get
1414
the package info and repository URL from `npm`, then try to fetch the GitHub
1515
release for each relevant version tag. If no GitHub release is found it will
1616
fall back to trying to parse the package's `CHANGELOG.md` or `changelog.md`.
@@ -19,34 +19,34 @@ them!
1919

2020
# Caveats
2121

22-
`what-broke` inevitably fails to find changelog entries for some packages/releases
22+
`npm-fetch-changelog` inevitably fails to find changelog entries for some packages/releases
2323
because many maintainers are not very detail-oriented about it (and don't choose
2424
to use excellent tools that would do the work for them, like
2525
[`semantic-release`](https://github.com/semantic-release/semantic-release)).
2626

2727
However, I've also seen cases where some versions were never published to npm
2828
(for instance, at the time of writing, `superagent` version 5.0.0 was never
29-
published to npm, yet it does have a changelog entry). `what-broke` currently
29+
published to npm, yet it does have a changelog entry). `npm-fetch-changelog` currently
3030
only displays changelog entries for published versions.
3131

3232
# API Tokens
3333

3434
GitHub heavily rate limits public API requests, but allows more throughput for
3535
authenticated requests. If you set the `GH_TOKEN` environment variable to a
36-
personal access token, `what-broke` will use it when requesting GitHub releases.
36+
personal access token, `npm-fetch-changelog` will use it when requesting GitHub releases.
3737

38-
`what-broke` will also use the `NPM_TOKEN` environment variable or try to get
38+
`npm-fetch-changelog` will also use the `NPM_TOKEN` environment variable or try to get
3939
the npm token from your `~/.npmrc`, so that it can get information for private
4040
packages you request.
4141

4242
# CLI
4343

4444
```
45-
npm i -g what-broke
45+
npm i -g npm-fetch-changelog
4646
```
4747

4848
```
49-
what-broke <package name>
49+
npm-fetch-changelog <package name>
5050
```
5151

5252
Prints changelog entries fetched from GitHub for each
@@ -58,6 +58,10 @@ version released on npm in the given range.
5858

5959
semver version range to get changelog entries for, e.g. `^7.0.0` (defaults to `>` the version installed in the working directory, if it exists)
6060

61+
### `--json`
62+
63+
output JSON instead of Markdown
64+
6165
### `--prereleases`
6266

6367
include prerelease versions
@@ -75,11 +79,11 @@ exclude patch versions (defaults to `--no-minor`)
7579
(the CLI just uses this under the hood)
7680

7781
```js
78-
import whatBroke from 'what-broke'
82+
import { fetchChangelog } from 'npm-fetch-changelog'
7983
```
8084

8185
```js
82-
async function whatBroke(
86+
async function fetchChangelog(
8387
package: string,
8488
options?: {
8589
include?: ?(((version: string) => boolean) | {
@@ -89,5 +93,11 @@ async function whatBroke(
8993
patch?: ?boolean,
9094
}),
9195
}
92-
): Promise<Array<{version: string, body: string}>>
96+
): Promise<{[version: string]: {
97+
version: string,
98+
header: string,
99+
body?: string,
100+
date?: Date,
101+
error?: Error,
102+
}}>
93103
```

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "what-broke",
2+
"name": "npm-fetch-changelog",
33
"version": "0.0.0-development",
44
"description": "list breaking changes in newer major versions of packages",
55
"main": "index.js",
66
"bin": {
7-
"what-broke": "./index.js"
7+
"npm-fetch-changelog": "./index.js"
88
},
99
"engines": {
1010
"node": ">=8.0.0"
@@ -71,7 +71,7 @@
7171
},
7272
"repository": {
7373
"type": "git",
74-
"url": "https://github.com/jedwards1211/what-broke.git"
74+
"url": "https://github.com/jedwards1211/npm-fetch-changelog.git"
7575
},
7676
"keywords": [
7777
"breaking-changes",
@@ -86,9 +86,9 @@
8686
"author": "Andy Edwards",
8787
"license": "MIT",
8888
"bugs": {
89-
"url": "https://github.com/jedwards1211/what-broke/issues"
89+
"url": "https://github.com/jedwards1211/npm-fetch-changelog/issues"
9090
},
91-
"homepage": "https://github.com/jedwards1211/what-broke#readme",
91+
"homepage": "https://github.com/jedwards1211/npm-fetch-changelog#readme",
9292
"devDependencies": {
9393
"@babel/cli": "^7.4.4",
9494
"@babel/core": "^7.1.6",

0 commit comments

Comments
 (0)