wikigeocode
Advanced tools
Comparing version 1.3.0 to 1.4.0
{ | ||
"name": "wikigeocode", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Simple utility to geocode a location using the wikimedia APIs.", | ||
@@ -10,5 +10,5 @@ "main": "index.js", | ||
"author": "Juan Convers", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"dependencies": { | ||
"node-fetch": "^2.3.0" | ||
"simple-fetch-cache": "^1.3.0" | ||
}, | ||
@@ -15,0 +15,0 @@ "devDependencies": { |
# wikigeocode | ||
This tiny module performs the geocode of a location using the wikimedia APIs, returning the wikipedia page title and the coordinates if available. For example: | ||
This tiny module performs the geocode of a location using the wikimedia APIs, returning the wikipedia page title and the coordinates if available, caching the results for an hour. For example: | ||
@@ -5,0 +5,0 @@ ```js |
@@ -1,5 +0,6 @@ | ||
const fetch = require('node-fetch') | ||
const {fetch} = require('simple-fetch-cache') | ||
const wikiprefix = 'https://en.wikipedia.org/w/api.php?action=query&format=json' | ||
module.exports = (suffix, value) => fetch(`${wikiprefix}${suffix}${value}`) | ||
.then(res => res.json()) | ||
module.exports = (suffix, value) => fetch(`${wikiprefix}${suffix}${value}`, 3600000) | ||
.then(res => res.reply) |
6114
7
+ Addedsimple-fetch-cache@^1.3.0
+ Addednode-fetch@2.6.1(transitive)
+ Addedsimple-fetch-cache@1.4.2(transitive)
+ Addedsimple-map-cache@1.0.0(transitive)
- Removednode-fetch@^2.3.0
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)