format-link-header
Advanced tools
Comparing version 2.1.0 to 3.0.0
@@ -1,14 +0,24 @@ | ||
## Changelog | ||
# Changelog | ||
### v2.1.0 | ||
## 3.0.0 | ||
### Breaking Changes | ||
- Remove support to unmantained Node.js versions (6 and 8) ([#7](https://github.com/jonathansamines/format-link-header/pull/7)) | ||
### Maintainance | ||
- Use nyc v15 ([#10](https://github.com/jonathansamines/format-link-header/pull/10)) | ||
- Use eslint v6 ([#8](https://github.com/jonathansamines/format-link-header/pull/8)) | ||
- Update project configurations and publishing settings ([#9](https://github.com/jonathansamines/format-link-header/pull/9)) | ||
- Use ava as test runner and built-in assertions library. Use nyc to instrument code for code coverage ([#7](https://github.com/jonathansamines/format-link-header/pull/7)) | ||
## 2.1.0 | ||
- Update mocha, chai and eslint to latests versions | ||
- Add node 8 and node 9 to test matrix | ||
### v2.0.0 | ||
- Updated code to ES6. | ||
- All devDependencies updates. | ||
- Removed support for node 0.10 and 0.12. | ||
- Added support for node 4 and node 6. | ||
## 2.0.0 | ||
- Updated code to ES6 | ||
- All devDependencies updates | ||
- Removed support for node 0.10 and 0.12 | ||
- Added support for node 4 and node 6 | ||
### v1.0.0 | ||
## 1.0.0 | ||
- First release. Added the full stringify process for parse-link-header. |
{ | ||
"name": "format-link-header", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "Format a link header object, to the original RFC 5988", | ||
"main": "src/index.js", | ||
"files": [ | ||
"src" | ||
], | ||
"scripts": { | ||
@@ -10,4 +13,4 @@ "lint": "eslint .", | ||
"pretest": "npm run lint", | ||
"test": "mocha test", | ||
"test:watch": "mocha test -w" | ||
"test": "nyc ava", | ||
"test:watch": "ava -w" | ||
}, | ||
@@ -25,4 +28,7 @@ "repository": { | ||
], | ||
"author": "Jonathan Samines <jn.samines@gmail.com> (http://jonathansamines.com)", | ||
"author": "Jonathan Samines <jn.samines@gmail.com>", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=10" | ||
}, | ||
"bugs": { | ||
@@ -33,8 +39,19 @@ "url": "https://github.com/jonathansamines/format-link-header/issues" | ||
"devDependencies": { | ||
"chai": "^4.1.2", | ||
"eslint": "^4.10.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-import": "^2.0.1", | ||
"mocha": "^4.0.1" | ||
"ava": "^2.4.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb-base": "^14.0.0", | ||
"eslint-plugin-import": "^2.19.1", | ||
"nyc": "^15.0.0" | ||
}, | ||
"nyc": { | ||
"check-coverage": true, | ||
"lines": 100, | ||
"statements": 100, | ||
"functions": 100, | ||
"branches": 100, | ||
"reporter": [ | ||
"lcov", | ||
"text-summary" | ||
] | ||
} | ||
} |
# format-link-header | ||
[![npm](https://img.shields.io/npm/v/format-link-header?style=flat-square)](https://www.npmjs.com/package/format-link-header) | ||
[![Build Status](https://img.shields.io/travis/jonathansamines/format-link-header/master.svg?style=flat-square)](https://travis-ci.org/jonathansamines/format-link-header) | ||
@@ -15,39 +16,39 @@ | ||
1. Given a links refs object generated by **parse-link-header**: | ||
1. Given a links refs object generated by [parse-link-header](https://github.com/thlorenz/parse-link-header): | ||
```js | ||
const link = { | ||
next: { | ||
page: '3', | ||
per_page: '100', | ||
rel: 'next', | ||
url: 'https://api.github.com/user/9287/repos?page=3&per_page=100' | ||
}, | ||
prev: { | ||
page: '1', | ||
per_page: '100', | ||
rel: 'prev', | ||
pet: 'cat', | ||
url: 'https://api.github.com/user/9287/repos?page=1&per_page=100' | ||
}, | ||
last: { | ||
page: '5', | ||
per_page: '100', | ||
rel: 'last', | ||
url: 'https://api.github.com/user/9287/repos?page=5&per_page=100' | ||
} | ||
```js | ||
const link = { | ||
next: { | ||
page: '3', | ||
per_page: '100', | ||
rel: 'next', | ||
url: 'https://api.github.com/user/9287/repos?page=3&per_page=100' | ||
}, | ||
prev: { | ||
page: '1', | ||
per_page: '100', | ||
rel: 'prev', | ||
pet: 'cat', | ||
url: 'https://api.github.com/user/9287/repos?page=1&per_page=100' | ||
}, | ||
last: { | ||
page: '5', | ||
per_page: '100', | ||
rel: 'last', | ||
url: 'https://api.github.com/user/9287/repos?page=5&per_page=100' | ||
} | ||
``` | ||
} | ||
``` | ||
2. Format the link header | ||
```js | ||
const formatter = require('format-link-header'); | ||
const linkHeaderString = formatter(link); | ||
``` | ||
```js | ||
const formatLink = require('format-link-header'); | ||
const linkHeaderString = formatLink(link); | ||
``` | ||
3. Web link headers generated! | ||
```bash | ||
<https://api.github.com/user/9287/repos?page=3&per_page=100>; rel="next", <https://api.github.com/user/9287/repos?page=1&per_page=100>; rel="prev"; pet="cat", <https://api.github.com/user/9287/repos?page=5&per_page=100>; rel="last" | ||
``` | ||
```bash | ||
<https://api.github.com/user/9287/repos?page=3&per_page=100>; rel="next", <https://api.github.com/user/9287/repos?page=1&per_page=100>; rel="prev"; pet="cat", <https://api.github.com/user/9287/repos?page=5&per_page=100>; rel="last" | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
54
7466
7
90
1