🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

accept-parser

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accept-parser - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+1
-1
package.json
{
"name": "accept-parser",
"version": "1.0.0",
"version": "1.0.1",
"description": "Accept parser",

@@ -5,0 +5,0 @@ "main": "accept-parser.js",

+22
-22

@@ -1,9 +0,9 @@

var ap = require('./accept-parser');
```
var ap = require('accept-parser');
```
============ ACCEPT ============
>>>>
req.headers['accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
>>>>
ap.parse(req.headers['accept'])
>>>>
## ACCEPT
```
ap.parse('text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
/*
[

@@ -15,10 +15,9 @@ { item: 'text/html', q: 1000 },

]
*/
```
====== ACCEPT-LANGUAGE =======
>>>>
req.headers['accept-language'] = 'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3'
>>>>
ap.parse(req.headers['accept-language'])
>>>>
## ACCEPT-LANGUAGE
```
ap.parse('zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3')
/*
[

@@ -30,13 +29,14 @@ { item: 'zh-CN', q: 1000 },

]
*/
```
====== ACCEPT-ENCODING =======
>>>>
req.headers['accept-encoding'] = 'gzip, deflate'
>>>>
ap.parse(req.headers['accept-encoding'])
>>>>
## ACCEPT-ENCODING
```
ap.parse('gzip, deflate')
/*
[
{ item: 'gzip', q: 1000 },
{ item: ' deflate', q: 1000 }
]
]
*/
```