🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

os-locale

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

os-locale

Get the system locale

latest
Source
npmnpm
Version
8.0.0
Version published
Weekly downloads
6.4M
-1.49%
Maintainers
1
Weekly downloads
 
Created
Source

os-locale

Get the system locale

[!NOTE] You may want new Intl.DateTimeFormat().resolvedOptions().locale instead. This package is useful for CLI tools as it also reads locale from environment variables (LC_ALL, LC_MESSAGES, LANG, LANGUAGE), which the Intl API does not fully support (it only respects LC_ALL).

Useful for localizing your module or app.

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

Install

npm install os-locale

Usage

import osLocale from 'os-locale';

console.log(osLocale());
//=> 'en-US'

API

osLocale()

Returns the locale.

Keywords

locale

FAQs

Package last updated on 04 Feb 2026

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