Security update for permissions_by_term
[yaffs-website] / node_modules / parse-headers / readme.md
1 # parse-headers[![build status](https://secure.travis-ci.org/kesla/parse-headers.svg)](http://travis-ci.org/kesla/parse-headers)
2
3 Parse http headers, works with browserify/xhr
4
5 [![NPM](https://nodei.co/npm/parse-headers.png?downloads&stars)](https://nodei.co/npm/parse-headers/)
6
7 [![NPM](https://nodei.co/npm-dl/parse-headers.png)](https://nodei.co/npm/parse-headers/)
8
9 [![Sauce Test Status](https://saucelabs.com/browser-matrix/kesla-xhr-headers.svg)](https://saucelabs.com/u/kesla-xhr-headers)
10
11 ## Installation
12
13 ```
14 npm install parse-headers
15 ```
16
17 ## Example
18
19 ### Input
20
21 ```javascript
22 var parse = require('./parse-headers')
23
24   , headers = [
25         'Date: Sun, 17 Aug 2014 16:24:52 GMT'
26       , 'Content-Type: text/html; charset=utf-8'
27       , 'Transfer-Encoding: chunked'
28       , 'X-Custom-Header: beep'
29       , 'X-Custom-Header: boop'
30     ].join('\n')
31
32 console.log(parse(headers))
33 ```
34
35 ### Output
36
37 ```
38 { date: 'Sun, 17 Aug 2014 16:24:52 GMT',
39   'content-type': 'text/html; charset=utf-8',
40   'transfer-encoding': 'chunked',
41   'x-custom-header': [ 'beep', 'boop' ] }
42 ```
43
44 ## Kudos
45
46 Looked at https://github.com/watson/http-headers before creating this.
47
48 ## Licence
49
50 Copyright (c) 2014 David Björklund
51
52 This software is released under the MIT license:
53
54 Permission is hereby granted, free of charge, to any person obtaining a copy
55 of this software and associated documentation files (the "Software"), to deal
56 in the Software without restriction, including without limitation the rights
57 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
58 copies of the Software, and to permit persons to whom the Software is
59 furnished to do so, subject to the following conditions:
60
61 The above copyright notice and this permission notice shall be included in
62 all copies or substantial portions of the Software.
63
64 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
69 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
70 THE SOFTWARE.