Gathering detailed insights and metrics for mock-browser-timezone
Gathering detailed insights and metrics for mock-browser-timezone
Gathering detailed insights and metrics for mock-browser-timezone
Gathering detailed insights and metrics for mock-browser-timezone
A Javascript library to mock the browser's timezone using ECMAScript Internationalization API.
npm install mock-browser-timezone
Typescript
Module System
Node Version
NPM Version
73.7
Supply Chain
87.7
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
14 Commits
1 Watchers
1 Branches
1 Contributors
Updated on May 13, 2021
Latest Version
1.0.2
Package Id
mock-browser-timezone@1.0.2
Unpacked Size
27.50 kB
Size
7.93 kB
File Count
14
NPM Version
6.14.10
Node Version
14.15.4
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A Javascript library to mock the browser's timezone using ECMAScript Internationalization API.
Many modern browsers use the Intl API to get the desired IANA timezone string which depicts the current browser timezone.
This library is specifically designed to mock the browser timezone, assisting to test the relevant code which uses the Intl
API.
npm install mock-browser-timezone --save-dev
yarn add mock-browser-timezone -D
For a better implementation of mock-browser-timezone
, have a look at mock-browser-timezone.js
file.
1const { 2 registerTimezone, 3 registerAbbreviatedTimezone, 4 reset, 5} = require('mock-browser-timezone'); 6 7// Mocking the timezone using IANA timezone string. 8registerTimezone('Europe/Paris'); 9 10reset(); // Default back to the orginal value. 11 12new Intl.DateTimeFormat().resolvedOptions().timeZone; // Europe/Paris 13 14registerAbbreviatedTimezone('CET'); 15 16new Intl.DateTimeFormat([], { 17 timeZoneName: 'short', 18}) 19 .formatToParts(date) 20 .find((locale) => locale.type === 'timeZoneName').value; // CET 21 22reset(); // Default back to the orginal abbreviated timezone value.
A list of supported IANA formatted timezones as well as abbreviated timezones can be found at timezones.json
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/14 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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