header-field
Advanced tools
Comparing version 0.2.2 to 1.0.0
{ | ||
"name": "header-field", | ||
"description": "Properly format a header field into a lowercased hyphenated string.", | ||
"version": "0.2.2", | ||
"version": "1.0.0", | ||
"author": "Dylan Piercey <pierceydylan@gmail.com>", | ||
"bugs": "https://github.com/DylanPiercey/header-field/issues", | ||
"devDependencies": { | ||
"gulp": "^3.9.0", | ||
"gulp-mocha": "^2.1.3" | ||
"@types/mocha": "^2.2.43", | ||
"@types/node": "^8.0.34", | ||
"mocha": "^4.0.1", | ||
"ts-node": "^3.3.0", | ||
"tslint": "^5.7.0", | ||
"typescript": "^2.5.3" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"homepage": "https://github.com/DylanPiercey/header-field", | ||
@@ -22,7 +29,14 @@ "keywords": [ | ||
"license": "MIT", | ||
"main": "index.js", | ||
"main": "dist/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DylanPiercey/header-field" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "npm run lint && tsc", | ||
"lint": "tslint -t codeFrame -c tslint.json '{src,test}/**/*.ts'", | ||
"prepublish": "npm test", | ||
"test": "npm run build && mocha -r ts-node/register ./test/**/*.test.ts" | ||
}, | ||
"types": "dist/index.d.ts" | ||
} |
@@ -1,2 +0,29 @@ | ||
# Header-Field | ||
<h1 align="center"> | ||
<!-- Logo --> | ||
<br/> | ||
header-field | ||
<br/> | ||
<!-- Stability --> | ||
<a href="https://nodejs.org/api/documentation.html#documentation_stability_index"> | ||
<img src="https://img.shields.io/badge/stability-stable-brightgreen.svg" alt="API Stability"/> | ||
</a> | ||
<!-- TypeScript --> | ||
<a href="http://typescriptlang.org"> | ||
<img src="https://img.shields.io/badge/%3C%2F%3E-typescript-blue.svg" alt="TypeScript"/> | ||
</a> | ||
<!-- NPM version --> | ||
<a href="https://npmjs.org/package/header-field"> | ||
<img src="https://img.shields.io/npm/v/header-field.svg" alt="NPM Version"/> | ||
</a> | ||
<!-- Downloads --> | ||
<a href="https://npmjs.org/package/header-field"> | ||
<img src="https://img.shields.io/npm/dm/header-field.svg" alt="Downloads"/> | ||
</a> | ||
<!-- Size --> | ||
<a href="https://npmjs.org/package/header-field"> | ||
<img src="https://img.shields.io/badge/size-396b-green.svg" alt="Browser Bundle Size"/> | ||
</a> | ||
</h1> | ||
Transform header fields into a properly formatted string, with lowercase characters and hyphens. | ||
@@ -14,10 +41,10 @@ | ||
```javascript | ||
var field = require('header-field'); | ||
import { normalize } from "header-field"; | ||
field("content-type"); //-> "content-type" | ||
field("content-Length"); //-> "content-length" | ||
field("Content-Disposition"); //-> "content-disposition" | ||
normalize("content-type"); //-> "content-type" | ||
normalize("content-Length"); //-> "content-length" | ||
normalize("Content-Disposition"); //-> "content-disposition" | ||
// Special case: referrer -> referer. | ||
field("Referrer"); //-> "referer" | ||
normalize("Referrer"); //-> "referer" | ||
``` | ||
@@ -27,4 +54,4 @@ | ||
* Use gulp to run tests. | ||
* Use `npm test` to build and run tests. | ||
Please feel free to create a PR! |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4663
0
56
0
6
6
20