0.0.1 • Published 9 years ago

simple-headers v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

simple-headers

Parse and serialize http headers.

To use

  1. Install it:

    $ npm i simple-headers
  2. Require it and use:

    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)