Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

header-field

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

header-field - npm Package Compare versions

Comparing version 0.2.2 to 1.0.0

dist/index.d.ts

24

package.json
{
"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!
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc