
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@zerodep/address-country
Advanced tools
A parser to find where a country name or abbreviation is in a string
A parser to find where a country name or abbreviation is in a string.
This function will return an array of results, with the most likely result being first. If a country is not found an empty array will be returned.
Full documentation is available at the zerodep.app page.
declare const addressCountry: (address: string, findInMiddle: boolean = false) => AddressCountry[];
interface AddressCountry {
countryIso2: CountryIso2[];
source: string;
ndx: number;
length: number;
}
The addressCountry function has the following parameters:
false)The addressCountry result has the following properties:
All @zerodep packages support both ESM and CJS formats, each complete with Typescript typings.
// ESM
import { addressCountry } from '@zerodep/address-country';
// CJS
const { addressCountry } = require('@zerodep/address-country');
// well formatted address
addressCountry('1234 Main Street, Los Angeles CA, America');
// [
// {
// countryIso2: 'US',
// source: 'America',
// ndx: 34,
// length: 7,
// },
// ]
// with Check-in-Middle Flag Enabled
const CHECK_IN_MIDDLE = true;
addressCountry('1234 Main Street, Los Angeles CA, United States 90210', CHECK_IN_MIDDLE);
// [
// {
// countryIso2: 'US',
// source: 'United States',
// ndx: 34,
// length: 13,
// },
// {
// countryIso2: 'CA',
// source: 'CA',
// ndx: 30,
// length: 2,
// },
// ]
// no results found
addressCountry('unknown');
// []
FAQs
A parser to find where a country name or abbreviation is in a string
The npm package @zerodep/address-country receives a total of 6 weekly downloads. As such, @zerodep/address-country popularity was classified as not popular.
We found that @zerodep/address-country demonstrated a not healthy version release cadence and project activity because the last version was released 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
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.