🚀 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

Accept parser

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
20
-28.57%
Maintainers
1
Weekly downloads
 
Created
Source
var ap = require('accept-parser');

ACCEPT

ap.parse('text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
/*
[
	{ item: 'text/html', q: 1000 },
	{ item: 'application/xhtml+xml', q: 1000 },
	{ item: 'application/xml', q: 900 },
	{ item: '*/*', q: 800 }
]
*/

ACCEPT-LANGUAGE

ap.parse('zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3')
/*
[
	{ item: 'zh-CN', q: 1000 },
	{ item: 'zh', q: 800 },
	{ item: 'en-US', q: 500 },
	{ item: 'en', q: 300 }
]
 */

ACCEPT-ENCODING

ap.parse('gzip, deflate')
/*
[
	{ item: 'gzip', q: 1000 },
	{ item: ' deflate', q: 1000 }
]
*/

Keywords

accept

FAQs

Package last updated on 27 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts