New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

browser-language

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-language

grab browser language and store on cookie

  • 1.0.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

#browser-language Build Status NPM version

grab browser language and store on cookie for nodejs

Installation

Install through NPM

npm install browser-language

or

git clone git://github.com/hex7c0/browser-language.git

API

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,
}));

language(options)

Options
  • dictionary - Object Accepted language
  • _default - String The dafault value, if request from client cannot be evaluated
  • en - String Set cookie with 'en' value
  • it - String Set cookie with 'it' value
  • .. - String Set cookie with '..' value
  • domain - 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

Examples

Take a look at my examples

License

Copyright (c) 2014 hex7c0

Licensed under the GPLv3 license.

Keywords

FAQs

Package last updated on 20 Jul 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc