Popularity
2.9
Growing
Activity
5.0
Declining
142
14
30

Code Quality Rank: L5
Monthly Downloads: 0
Programming language: JavaScript
License: MIT License
Tags: Miscellaneous     String     Str     System     Language     User     Os     Region     Identifier     Id     Country     Lang     Locale    

os-locale alternatives and similar modules

Based on the "Miscellaneous" category

Do you think we are missing an alternative of os-locale or a related project?

Add another 'Miscellaneous' Module

README

os-locale Build Status

Get the system locale

Useful for localizing your module or app.

POSIX systems: The returned locale refers to the LC_MESSAGE category, suitable for selecting the language used in the user interface for message translation.

Install

$ npm install os-locale

Usage

const osLocale = require('os-locale');

(async () => {
    console.log(await osLocale());
    //=> 'en-US'
})();

API

osLocale(options?)

Returns a Promise for the locale.

osLocale.sync(options?)

Returns the locale.

options

Type: Object

spawn

Type: boolean Default: true

Set to false to avoid spawning subprocesses and instead only resolve the locale from environment variables.


Get professional support for 'os-locale' with a Tidelift subscription Tidelift helps make open source sustainable for maintainers while giving companiesassurances about security, maintenance, and licensing for their dependencies.