0.0.1 • Published 9 years ago
simple-headers v0.0.1
simple-headers
Parse and serialize http headers.
To use
Install it:
$ npm i simple-headers
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)
0.0.1
9 years ago