JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 97
  • Score
    100M100P100Q64171F
  • License MIT

The globalize middleware for the express framework

Package Exports

  • globalize-express

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 (globalize-express) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

globalize-express

The globalize middleware for the express framework

Install

npm install globalize-express

Load

// load modules
var express = require('express'),
    globalizeExpress = require("globalize-express");
    

Simple Example

//Add as a middleware to your express app
app.use(globalizeExpress(config));
    

list of configuration options

var config = {
    // list of supported locales
    locales:['en', 'ja],

    // you may alter a site wide default locale
    defaultLocale: 'en',

    // sets a custom cookie name to parse locale settings from
    cookieName: null,

    // where are the locale json files stored
    directory: __dirname + '/locales',

    // An array of cldr data to load into globalize
    // Checkout: https://github.com/jquery/globalize#2-cldr-content
    localeData: [
    ],

    // Set if running in development mode. This will delete cache before every access
    devMode: false
};