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 - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

13

index.js

@@ -7,3 +7,3 @@ "use strict";

* @subpackage index
* @version 0.0.1
* @version 1.0.0
* @author hex7c0 <0x7c0@teboss.tk>

@@ -119,8 +119,13 @@ * @license GPLv3

*
* @param string filename: name of log
* @param integer maxsize: max size of log
* @param bollean json: if write data with json format
* @param object dictionary: accepted languages
*/
var LANG = dictionary || require('./lib/dictionary.js').LANG;
if (dictionary._default == undefined) {
// force
var LANG = require('./lib/dictionary.js').LANG;
} else if (!languageAll[dictionary._default]) {
console.error('language misconfigured');
var LANG = require('./lib/dictionary.js').LANG;
}
process.env.LANG = LANG._default;

@@ -127,0 +132,0 @@

@@ -7,3 +7,3 @@ "use strict";

* @subpackage lib
* @version 0.0.1
* @version 1.0.0
* @author hex7c0 <0x7c0@teboss.tk>

@@ -10,0 +10,0 @@ * @license GPLv3

{
"name": "browser-language",
"version": "0.0.1",
"version": "1.0.0",
"description": "simple language middleware for express",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,5 +0,5 @@

logger-request [![Build Status](https://travis-ci.org/hex7c0/logger-request.svg?branch=master)](https://travis-ci.org/hex7c0/logger-request) [![NPM version](https://badge.fury.io/js/logger-request.svg)](http://badge.fury.io/js/logger-request)
browser-language [![Build Status](https://travis-ci.org/hex7c0/browser-language.svg?branch=master)](https://travis-ci.org/hex7c0/browser-language) [![NPM version](https://badge.fury.io/js/browser-language.svg)](http://badge.fury.io/js/browser-language)
==============
simple logger middleware for express
simple language middleware for express

@@ -10,21 +10,28 @@ ## API

var app = require('express')();
var logger-request = require('logger-request');
var cookie = require('cookie-parser');
var browser-language = require('browser-language');
app.use(logger-request({filename:'pippo.log'}));
app.use(cookie('pippo'));
app.use(browser-language({_default:'en',en:'en'}));
```
### logger-request(options)
### browser-language(dictionary)
Setup session store with the given `options`.
Setup accepted languages with the given `dictionary` (object).
#### Options
- `filename` - The filename of the logfile to write output to.
- `maxsize` - Max size in bytes of the logfile, if the size is exceeded then a new file is created.
- `json` - If true, messages will be logged as JSON (default true).
- `_default` - The dafault value, if request from client cannot be evaluated
- `en` - Set cookie with 'en' value
- `it` - Set cookie with 'it' value
- `..` - Set cookie with '..' value
releated to https://github.com/flatiron/winston#file-transport
object with correct value to be added, otherwise using a default dictionary inside /lib/dictionary.js
#### Examples
Take a look at my [examples](https://github.com/hex7c0/browser-language/tree/master/examples)
## License
Copyright (c) 2014 hex7c0
Licensed under the GPLv3 license.
Licensed under the GPLv3 license.

Sorry, the diff of this file is not supported yet

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