simple-headers

0.0.1 • Public • Published

simple-headers

Parse and serialize http headers.

To use

  1. Install it:
```bash
$ npm i simple-headers
```
  1. Require it and use:
```js
var simpleHeaders = require('simple-headers');
```

Example

var simpleHeaders = require('simple-headers');
 
var headerObject = {
  'content-type': 'text/html;',
  'cache-control': 'no-cache'
};
 
var serial = simpleHeaders.stringify(headerObject);
// "Content-Type: text/html;\r\nCache-Control: no-cache\r\n"
 
simpleHeaders.parse(serial);
// {
//   'content-type': 'text/html;',
//   'cache-control': 'no-cache'
// }

License

MIT © 2015 Sunny (darkowlzz)

Package Sidebar

Install

npm i simple-headers

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • darkowlzz