Package Exports
- express-langs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-langs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
express-langs
parse langs from request for easier use with express

resolve langagues accept in header
requestgetarraylangagues withrequest.langs
Installation
npm install express-langs --save
yarn add express-langs
server.js
const
exp = require('express')
, app = exp()
, langs = require('express-langs')
;
app
// your other middleware ...
.use( langs() )
// your other middleware ...
;
app.get('/' , ( req , res ) => {
console.log( req.langs ) ;
res.send('hello world !') ;
} )
you can give an default langagues optional if header ACCEPT is not defined or null
server.js
// , ...
app
// your other middleware ...
.use( langs('en') )
// your other middleware ...
;
// ... ,