
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
address-complete
Advanced tools
What are you looking for? Or how?
Address-complete provide unified way to perform address autocomplete using 3 geo-data providers:
This library provides both basic address autocompete features, and extended address details extraction to enable complex forms to shine.
npm install address-autocomplete
%provider_name%.search(term): Promise
%provider_name%.getDetails(term): PromiseNor google, nor yandex will NOT work in browser due to CORS limitations.
Use mapzen instead.
there is live example at codesandbox - https://codesandbox.io/s/y382k7n61j
import mapzen, {configure} from 'address-autocomplete/mapzen';
import google, {configure} from 'address-autocomplete/google';
import yandex, {configure} from 'address-autocomplete/yandex';
// Google and MapZen does require an API key;
configure('YOUR_API_KEY');
mapzen
.search('something')
.then(autocompletedData => async {
// array of objects with .text field
const fullData = await Promise.all(autocompletedData.map(mapzen.getDetails));
// array of object with coordinates as AddressDetails data
})
PS: To say they truth - you have to call getDetails only for Google API. All other API just mimic Google's behavior.
mapzen
.search('something')
.then(fullData => {
// hooray! I've already got everything!
})
google
.search('something')
.then(fullData => {
// only fullData[0].text
// noooo :( :(
})
This library comes with TS and Flow definition, but anyway
Response from Google.search is AddressResponse
interface AddressResponse {
id: number,
text: string,
}
Response and any other API, or from google.getDetails
interface DetailedAddressResponse extends AddressResponse {
point: number[],
addressDetails: {
country: {
name: string,
code?: string // as iso3166-1
},
region: {
name: string,
code?: string, // as iso3166-2
},
locality: {
name: string
},
street: {
name: string,
house: string,
label: string,
},
postalcode: string
}
}
Hey! How to get list of countries or list of states for a country?
Just use iso3166-2-db
import listOfCountries from 'iso3166-2-db/countryList/UN/en';
address complete uses iso3166-2-db to extract iso3166-2 regions names from MapZen answers.
I could recommend:
MIT
FAQs
What are you looking for?
The npm package address-complete receives a total of 24 weekly downloads. As such, address-complete popularity was classified as not popular.
We found that address-complete demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.