Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@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.
But all the zipcode files are inside the repo?
Yes, but they are in .npmignore and are fetched with jsdelivr.com directly from Github.
npm install @omnicar/sam-zip-city
or yarn add @omnicar/sam-zip-city
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 0 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.