Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
node-postcodes.io
Advanced tools
Readme
An easy to use postcodes.io wrapper for NodeJS.
Install the package with npm:
$ npm i node-postcodes.io
const postcodes = require('node-postcodes.io')
http://postcodes.io/docs#Postcode-Lookup
// single
let result = await postcodes.lookup('PO123AA')
// batch
let result = await postcodes.lookup(['PO123AA', 'PO123AB'])
// batch (with filter)
let result = await postcodes.lookup(['PO123AA', 'PO123AB'], {
filter: 'postcode,longitude,latitude'
})
http://postcodes.io/docs#Geocode-Postcode
//
let result = await postcodes.geo(51.7923246977375, 0.629834723775309)
// with optional params
let result = await postcodes.geo(51.7923246977375, 0.629834723775309, {
limit: 10,
radius: 10,
wideSearch: false
})
//
let result = await postcodes.geo([
{
"longitude": 0.629834723775309,
"latitude": 51.7923246977375,
"radius": 1000,
"limit": 5
},{
"longitude": -2.49690382054704,
"latitude": 53.5351312861402,
"radius": 1000,
"limit": 5
}
])
// with optional params
let result = await postcodes.geo([
{
"longitude": 0.629834723775309,
"latitude": 51.7923246977375,
"radius": 1000,
"limit": 5
},{
"longitude": -2.49690382054704,
"latitude": 53.5351312861402,
"radius": 1000,
"limit": 5
}
], {
filter: 'postcode,longitude,latitude',
wideSearch: false
})
http://postcodes.io/docs#Geocode-Postcode
let result = await postcodes.random()
http://postcodes.io/docs#Postcode-Validation
let result = await postcodes.validate('PO123AA')
http://postcodes.io/docs#Nearest-Postcode
let result = await postcodes.nearest('PO123AA')
// with optional params
let result = await postcodes.nearest('PO123AA', {
radius: 1000,
limit: 5
})
http://postcodes.io/docs#Postcode-Autocomplete
let result = await postcodes.autocomplete('PO123AA')
// with optional params
let result = await postcodes.autocomplete('PO123AA', {
limit: 5
})
http://postcodes.io/docs#Postcode-Query
let result = await postcodes.query('PO123AA')
// with optional params
let result = await postcodes.query('PO123AA', {
limit: 5
})
http://postcodes.io/docs#Terminated
let result = await postcodes.terminated('PO123AA')
http://postcodes.io/docs#Show-Outcode
// lookup
let result = await postcodes.outcodes('PO33')
// nearest
let result = await postcodes.outcodes('PO3', {
limit: 10,
radius: 10
})
// nearest (lat, lng)
let result = await postcodes.outcodes(51.7923246977375, 0.629834723775309)
// with optional params
let result = await postcodes.outcodes(51.7923246977375, 0.629834723775309, {
limit: 10,
radius: 10
})
http://postcodes.io/docs#Place-Lookup
// lookup
let result = await postcodes.places('osgb4000000074553605')
// query
let result = await postcodes.places('Ryde', {
limit: 10
})
// random
let result = await postcodes.places()
Can see test results @ https://travis-ci.org/lcherone/node-postcodes.io, if you want to run them locally, your need install mocha, then run:
$ npm test
The MIT License (MIT). Please see License File for more information.
FAQs
Postcodes.io - NodeJS Client/Wrapper
The npm package node-postcodes.io receives a total of 260 weekly downloads. As such, node-postcodes.io popularity was classified as not popular.
We found that node-postcodes.io 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.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.