Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@omnicar/sam-zip-city
Advanced tools
This library aims to do city lookups in a fast (client-side), generic way.
The script will dynamically load the appropriate file with zipcodes and city names for a given country.
This allows for smaller bundle size and means that the file(s) are only downloaded when needed.
npm install @omnicar/sam-zip-city
or yarn add @omnicar/sam-zip-city
Question:
But are all the zip code files inside the imported package?
Answer: No, only the file(s) with the postal codes (zip codes) of the requested country are retrieved dynamically at run time.
Question:
From where are the file(s) with the postal codes (zip codes) fetched from?
Answer: The postal codes are fetched from admin dot
omnicar dot
io slash
data slash
zip-codes slash
import { getCityFromZip } from '@omnicar/sam-zip-city'
const myFunc = async () => {
const city = await getCityFromZip({
zipcode: 2300,
country: 'DK'
})
console.log(city)
}
Or to initialise a country before requesting a city:
import { initZipCityCountry } from '@omnicar/sam-zip-city'
const myOtherFunc = async () => {
await initZipCityCountry({ country: 'DK' })
console.log('Danish zipcodes and cities should be ready!')
}
FAQs
A simple tool for looking up city names based on zipcode inputs.
The npm package @omnicar/sam-zip-city receives a total of 3 weekly downloads. As such, @omnicar/sam-zip-city popularity was classified as not popular.
We found that @omnicar/sam-zip-city demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.