Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
#what3words
###Getting started
$ npm install --save what3words
###Usage ###Node.js
var w3w = require('what3words');
####Config
var options = {
key : '<YOUR_API_KEY_HERE>',
lang : 'en',
display : 'terse'
}
w3w.config(options);
######options All config options can be overidden in function calls. Each config option will be included in every call that is not overidden by the specific function call.
key
(required) - your API key (get yours here)lang
(optional) - a supported w3w address language: en
(the default), de, ru, sv, pt, sw, it, fr, es
or tr
.format
(optional) - return data format type. Can be json
(the default), geojson
or xml
display
(optional) - return display type. Can be full
(the default) or terse
####Functions
For each of the functions below, all options are passed in the first function parameter. If a second parameter is included, that will be the functions callback. If not, the function will return a Promise
.
#####forward(options[, callback]) ######options
addr
(required) - a 3 word address as a stringlang
(optional) - a supported w3w address language (see Config)format
(optional) - return data format type (see Config)display
(optional) - return display type (see Config)#####reverse(options[, callback]) ######options
coords
(required) - coordinates as a comma separated string of latitude and longitudelang
(optional) - a supported w3w address language (see Config)format
(optional) - return data format type (see Config)display
(optional) - return display type (see Config)#####autosuggest(options[, callback]) ######options
addr
(required) - a 3 word address as a stringlang
(optional) - a supported w3w address language (see Config)format
(optional) - return data format type (see Config)display
(optional) - return display type (see Config)focus
(optional) - a location, specified as a latitude,longitude used to refine the results.clip
(optional) - Restricts results to those within a geographical area. If omitted defaults to clip=none
.#####standardblend(options[, callback]) ######options
addr
(required) - a 3 word address as a stringlang
(optional) - a supported w3w address language (see Config)format
(optional) - return data format type (see Config)focus
(optional) - a location, specified as a latitude,longitude used to refine the results.#####grid(options[, callback]) ######options
bbox
(required) - Bounding box, specified by the northeast and southwest corner coordinates, for which the grid should be returnedformat
(optional) - return data format type (see Config)#####languages(options[, callback]) ######options
format
(optional) - return data format type (see Config)####Example
var w3w = require('what3words');
w3w.config({
key : '<INSERT_YOUR_API_KEY>',
lang : 'en'
});
w3w.forward({
addr : 'steep.sober.potato',
display : 'terse'
}, function (err, res){
if (err) console.log(err);
else console.log(JSON.stringify(res, null, 4));
});
####Test
$ npm test
FAQs
Node client for what3words API
The npm package what3words receives a total of 4 weekly downloads. As such, what3words popularity was classified as not popular.
We found that what3words 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.