
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Guesses the user's regional parameters on-device.
This library relies on the window
object of the user's browser. It guesses timezone, country and the preferred language. It's stateless. Only two methods: guess
and match
. As there is no %100 accurate way of detecting user's regional parameters, this library tries its chance by combinating the outputs of window.Intl
and window.navigator
objects.
npm i regionist
or inject with script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/regionist@7/dist/regionist.iife.js"></script>
<script type="text/javascript">
console.log(window.Regionist)
</script>
import { regionist } from 'regionist'
// or
// const { regionist } = require('regionist')
// guess
const guessResult = regionist.guess()
console.assert(guessResult === {
timezone: 'America/New_York', // timezone name as returned by window.Intl object
timezoneCountry: 'US', // mapped from the timezone
preferredLocale: 'tr-TR', // relies on window.navigator
preferredLanguage: 'tr' // it's just derived from preferredLocale
})
// match, useful for finding the best matching locale against a list of supported locales
const bestLocale = regionist.match(['az-AZ', 'en-US', 'tr-TR'])
console.assert(bestLocale === 'tr-TR') // because user's preferred locale is tr-TR
const bestLocale2 = regionist.match(['az_AZ', 'en_us', 'tr_tr'])
console.assert(bestLocale === 'tr-TR') // always returns formatted
If you're interested in contributing, read the CONTRIBUTING.md first, please.
Thanks for the attention 💙 Any amount of support on patreon or github will return you back as bug fixes, new features and bits and bytes.
FAQs
Guesses the user's regional parameters on-device.
The npm package regionist receives a total of 10 weekly downloads. As such, regionist popularity was classified as not popular.
We found that regionist demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.