Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including angular-ziptastic with all npm packages installed. Try it out:

require("angular/package.json"); // angular is a peer dependency. var angularZiptastic = require("angular-ziptastic")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

angular-ziptastic v1.2.0

Ziptastic ZIP -> City/State lookups for Angular

angular-ziptastic Build Status

Ziptastic ZIP -> City/State lookups for Angular


# use npm
$ npm install angular-ziptastic
# or bower
$ bower install angular-ziptastic


Include 'ziptastic' in your module's dependencies:

// node module exports the string 'ziptastic' for convenience
angular.module('myApp', [
// otherwise, include the code first then the module name
angular.module('myApp', [



base(baseUrl) -> undefined

Sets the default base URL for requests. Defaults to ''.

country(country) -> undefined

Set the default country to use in requests. Defaults to 'US'.

$http(config) -> undefined

Set default config for $http. Defaults to undefined. config is an object that will be passed directly to $http and can be used to set config options like timeout and cache


lookup(code|options) -> promise

Performs a Ziptastic lookup, either with a code string or an options object that specifies:

  • code (string): The postal code
  • country (string): Overrides the default country
  • base (string): Overrides the default base
  • $http (object): Overrides the default $http configuration

Returns a $q promise for the Ziptastic response.

  .then(function (data) {
      city: 'New York City',
      country: 'US',
      county: 'New York',
      state: 'New York',
      state_short: 'NY',
      postal_code: '10009'
  .catch(function (err) {
    console.err('Error in lookup', err);
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free