Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
browser-language
Advanced tools
grab browser language and store on cookie for nodejs
Install through NPM
npm install browser-language
or
git clone git://github.com/hex7c0/browser-language.git
Normal use inside expressjs project
var language = require('browser-language');
var app = require('express')();
app.use(language({
dictionary: {
_default: 'en',
en: 'en',
},
cookie: 'new_cookie_name',
}));
Signed use inside expressjs project
var language = require('browser-language');
var app = require('express')();
var cookie = require('cookie-parser');
app.use(cookie('foo'));
app.use(language({
dictionary: {
_default: 'en',
en: 'en',
},
cookie: 'new_cookie_name',
signed: true,
}));
dictionary
- Object Accepted language_default
- String The dafault value, if request from client cannot be evaluateden
- String Set cookie with 'en' valueit
- String Set cookie with 'it' value..
- String Set cookie with '..' valuedomain
- String Domain of cookie (default "null")cookie
- String Name of cookie (default "lang")path
- String Path of cookie (default "/")age
- Number Age of cookie in millisecond (default "1 year")httpOnly
- Boolean Flag for http only cookie (default "false")secure
- Boolean Flag for using cookie over TLS/SSL (default "false")signed
- Boolean Will use the secret passed to cookieParser(secret) to sign the value (default "false")dictionary
object with correct value to be added, otherwise using a default dictionary inside ./lib/dictionary.js
Take a look at my examples
Copyright (c) 2014 hex7c0
Licensed under the GPLv3 license.
FAQs
grab browser language and store on cookie
The npm package browser-language receives a total of 4 weekly downloads. As such, browser-language popularity was classified as not popular.
We found that browser-language demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.