Gathering detailed insights and metrics for hapi-accept-language2
Gathering detailed insights and metrics for hapi-accept-language2
npm install hapi-accept-language2
Typescript
Module System
Node Version
NPM Version
69.6
Supply Chain
99.3
Quality
75.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
24,458
Last Day
1
Last Week
5
Last Month
18
Last Year
423
8 Commits
2 Forks
1 Watching
2 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.3
Package Id
hapi-accept-language2@2.0.3
Unpacked Size
10.34 kB
Size
2.92 kB
File Count
5
NPM Version
5.6.0
Node Version
8.11.1
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
25%
5
Compared to previous week
Last month
-40%
18
Compared to previous month
Last year
-60.5%
423
Compared to previous year
1
Parses Accept-Language
header on requests for HapiJS and attaches them to request. Extracts language, region, script, and quality as per RFC-5646 best practices. Based on hapi-accept-language with better tests, options, and failovers; uses accept-language-parser. Special thanks to OpenTable for their work.
npm install --save hapi-accept-language2
npm install --save hapi-accept-language2@1
1const Hapi = require('hapi'); 2 3const hapiAcceptLanguage = { 4 plugin: 'hapi-accept-language2', 5 options: { 6 7 // Set server default language using RFC-5646 language tags 8 // Optional 9 defaultLanguage: 'es-Latn-ES' 10 } 11}; 12 13 14server = new Hapi.Server({ port: 4111 }); 15 16server.route({ 17 18 method: 'GET', 19 path: '/', 20 handler: (request, reply) => { 21 22 return { 23 headers: request.raw.req.headers, 24 pre: request.pre, 25 languages: request.pre.language 26 } 27 } 28}); 29 30await server.register([hapiAcceptLanguage]); 31 32await server.start(/* ... */);
1const Hapi = require('hapi'); 2 3const hapiAcceptLanguage = { 4 register: 'hapi-accept-language2', 5 options: { 6 7 // Set server default language using RFC-5646 language tags 8 // Optional 9 defaultLanguage: 'es-Latn-ES' 10 } 11}; 12 13server = new Hapi.Server(); 14server.connection({ port: 4111 }); 15 16server.route({ 17 18 method: 'GET', 19 path: '/', 20 handler: (request, reply) => { 21 22 reply({ 23 headers: request.raw.req.headers, 24 pre: request.pre, 25 languages: request.pre.language 26 }).code(200); 27 } 28}); 29 30server.register([hapiAcceptLanguage], {}, (err) => { 31 32 if (err) { 33 return done(err); 34 } 35 36 server.start(/* ... */); 37});
git clone git://github.com/damusix/hapi-accept-language2.git
cd hapi-accept-language2
npm install
Please include tests and submit a pull request with your contributions.
npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-13
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More