Skip to content

jcblw/geode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geode

Greenkeeper badge

Build StatusCoverage Status

Locations API in node from www.geonames.org

Install

npm install geode

Use

You will need an account ~ its free (signup).

//include
var geo = new geode('username', {language: 'en', countryCode : 'US'})

geo.search({name :'Riverside'}, function(err, results){
	console.log([err, results])
})

Demo

Here is a simple Express App throwing up an API. (see demo).

The express code is just

var api = new Geode('username', {countryCode: "US", language: 'en'});

app.get('/:collection.:format', function(req, res){
  if(req.params.collection && req.params.format){
    api[req.params.collection](req.query, function(err, collection){
      res[req.params.format]({status : 200, results : collection});
    });
  }else{
    res.send('404');
  }
})

Testing

Make sure to install the development dependecies npm install --dev and then run.

USER=yourusername npm test

About

🌎 wrapper for www.geonames.org written in javascript as a node module

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published