Gathering detailed insights and metrics for os-locale-s
Gathering detailed insights and metrics for os-locale-s
Gathering detailed insights and metrics for os-locale-s
Gathering detailed insights and metrics for os-locale-s
Its a light weight version that minimizes the dependency module of `os-locale`
npm install os-locale-s
Typescript
Module System
Min. Node Version
Node Version
NPM Version
82.2
Supply Chain
95.5
Quality
76
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
208,696
Last Day
419
Last Week
4,436
Last Month
16,323
Last Year
118,104
MIT License
1 Stars
19 Commits
1 Forks
2 Watchers
1 Branches
1 Contributors
Updated on May 09, 2025
Minified
Minified + Gzipped
Latest Version
1.0.26
Package Id
os-locale-s@1.0.26
Unpacked Size
25.84 kB
Size
5.88 kB
File Count
8
NPM Version
9.8.1
Node Version
18.18.0
Published on
Jan 12, 2024
Cumulative downloads
Total Downloads
Last Day
-2.8%
419
Compared to previous day
Last Week
0.4%
4,436
Compared to previous week
Last Month
36.8%
16,323
Compared to previous month
Last Year
37.9%
118,104
Compared to previous year
1
2
Its a light weight version that minimizes the dependency module of os-locale
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.
I was creating a module package and needed to detect the locale.
At that time, I found a module os-locale
that provides the corresponding function in the npm package.
I just wanted to detect locale token such as "cs", "de", "es", "fr" etc but
os-locale
installs as many as 27 npm packages, including indirectly dependent modules
yarn add os-locale
I just wanted to detect a simple locale token but thought this was overwork and decided to rewrite the code.
At the same time, has been migrate to TypeScript
as well.
As a result, the number of npm packages installed in
os-locale-s
has been reduced to 3 includingos-locale-s
$ npm install os-locale-s
1// node (commenjs) 2const { osLocale } = require("os-locale-s"); 3(async () => { 4 console.log(await osLocale()); 5 //=> 'en-US' 6})();
1// ECMA module 2import { osLocale } from "os-locale-s"; 3(async () => { 4 console.log(await osLocale()); 5 //=> 'en-US' 6})();
Returns a Promise
for the locale.
Returns the locale.
Type: object
Type: boolean
Default: true
Set to false
to avoid spawning subprocesses and instead only resolve the locale from environment variables. (process.env
)
Type: boolean
Default: true
Once the locale is detected, its value is retained and reused at the second and subsequent detections.
If set to false
, the last held value will be ignored and do locale detection again (and the resulting value is not preserved)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
no SAST tool detected
Details
Reason
Found 0/19 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More