{ "name": "caseless", "version": "0.6.0", "description": "Caseless object set/get/has, very useful when working with HTTP headers.", "main": "index.js", "scripts": { "test": "node test.js" }, "repository": { "type": "git", "url": "https://github.com/mikeal/caseless" }, "keywords": [ "headers", "http", "caseless" ], "test": "node test.js", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" }, "license": "BSD", "bugs": { "url": "https://github.com/mikeal/caseless/issues" }, "devDependencies": { "tape": "^2.10.2" }, "readme": "## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing.\n\nThis library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manor while also preserving the caseing of headers the first time they are set.\n\n## Usage\n\n```javascript\nvar headers = {}\n , c = caseless(headers)\n ;\nc.set('a-Header', 'asdf')\nc.get('a-header') === 'asdf'\n```\n\n## has(key)\n\nHas takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with.\n\n```javascript\nc.has('a-header') === 'a-Header'\n```\n\n## set(key, value[, clobber=true])\n\nSet is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header.\n\n```javascript\nc.set('a-Header', 'fdas')\nc.set('a-HEADER', 'more', false)\nc.get('a-header') === 'fdsa,more'\n```\n\n## swap(key)\n\nSwaps the casing of a header with the new one that is passed in.\n\n```javascript\nvar headers = {}\n , c = caseless(headers)\n ;\nc.set('a-Header', 'fdas')\nc.swap('a-HEADER')\nc.has('a-header') === 'a-HEADER'\nheaders === {'a-HEADER': 'fdas'}\n```\n", "readmeFilename": "README.md", "homepage": "https://github.com/mikeal/caseless", "_id": "caseless@0.6.0", "_shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4", "_from": "caseless@~0.6.0", "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz" }