New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cloudmade-lib

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudmade-lib

a client library for cloudmade geocode API

  • 0.1.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Cloudmade Lib

A node library for consuming Cloudmade APIs. Currently only supports Geocoding.

Build Status Coverage Status

Features

  • Geocoding
    • Output types for JSON, GeoJSON, Property list and HTML

Install

npm install cloudmade-lib

Usage

JSON

To retrieve results in JSON format, see the following example:

var
	cloudmade = require('cloudmade-lib'),
	geocoding = cloudmade.geocoding.initialize({
		apikey : 'your_api_key_here'
	});

geocoding.get('8727 148th Ave NE, Redmond, WA 98052', function (err, data) {
	// work with results here...
});

Timeout for Execution

By default, the timeout for connecting to the Cloudmade API is 5 seconds. This can be overridden via the options parameter which accepts a value in milliseconds.

var
	cloudmade = require('cloudmade-lib'),
	geocoding = cloudmade.geocoding.initialize({
		apikey : 'your_api_key_here'
	});

geocoding.get({ timeout : 10000 }, '8727 148th Ave NE, Redmond, WA 98052', function (err, data) {
	// work with results here...
});

GeoJSON

To retrieve results in GeoJSON format, see the following example:

var
	cloudmade = require('cloudmade-lib'),
	geocoding = cloudmade.geocoding.initialize({
		apikey : 'your_api_key_here'
	});

geocoding.getGeo('8727 148th Ave NE, Redmond, WA 98052', function (err, data) {
	// work with results here...
});

Propert list

To retrieve results in Plist format, see the following example:

var
	cloudmade = require('cloudmade-lib'),
	geocoding = cloudmade.geocoding.initialize({
		apikey : 'your_api_key_here'
	});

geocoding.getPlist('8727 148th Ave NE, Redmond, WA 98052', function (err, data) {
	// work with results here...
});

HTML

To retrieve results in HTML format, see the following example:

var
	cloudmade = require('cloudmade-lib'),
	geocoding = cloudmade.geocoding.initialize({
		apikey : 'your_api_key_here'
	});

geocoding.getHtml('8727 148th Ave NE, Redmond, WA 98052', function (err, data) {
	// work with results here...
});

Optional Parameters

Additional parameters, as outlined at http://developers.cloudmade.com/projects/show/geocoding-http-api#Parameters, can be supplied easily during the request.

var
	cloudmade = require('cloudmade-lib'),
	geocoding = cloudmade.geocoding.initialize({
		apikey : 'your_api_key_here'
	}),
	options = {
		around : '47.6742,122.1203'
		results : 100,
		skip : 100
	};

geocoding.get(options, '8727 148th Ave NE, Redmond, WA 98052', function (err, data) {
	// work with results here...
});

Response Data

The results returned from the cloudmade API are wrapped with the following fields:

{
	"apikey" : "your_api_key_here",
	"data" : { /* Cloudmade Response Here */ },
	"host" : "geocoding.cloudmade.com",
	"path" : "/geocoding/v2/find.js",
	"query" : "?query=8727%20148th%20Ave%20NE%2C%20Redmond%2C%20WA%2098052",
	"secure" : false
}

For more information about cloudmade's response data: http://developers.cloudmade.com/projects/show/geocoding-http-api#Geocoding-responses

License

MIT, see LICENSE

Keywords

FAQs

Package last updated on 03 Jul 2013

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc