Socket
Socket
Sign inDemoInstall

google-timezone-api

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    google-timezone-api

Easy way to use the google timezone api


Version published
Weekly downloads
64
increased by25.49%
Maintainers
1
Install size
39.5 kB
Created
Weekly downloads
 

Readme

Source

#google-timezone-api ##module.exports(uOpts, [callback]) ⏏ You can use this module via promises or by using a callback.

The first parameter passed is an object which corresponds to variables you'd pass to the google time zone api.

An example options object:

{
		location: '43.7182713,-79.3777061', // REQUIRED: location you'd like to get timezone info for
		timestamp: '10000', // OPTIONAL: Timestamp which is used to calculate daylight savings if omitted Date.now will be used
		key: 'your api key', // OPTIONAL: You may want to pass in an API key. However it's optional.
		language: 'en' // OPTIONAL: Language of the returned data
}

This module can be used both in Node and in the browser via Browserify.

Visit https://developers.google.com/maps/documentation/timezone/ for more info.

Params

  • uOpts Object - Options used to communicate with the timezone api. See above for details.
  • [callback] function - Callback is optional but can be used instead of promises. Returned data will be in the form of callback( err, result )

Returns: Promise - This function will return a promise from which you can consume the resulting data
Example


var timezone = require( '../' );

timezone( {

	location: '43.7182713,-79.3777061'
}).then( function( result ) {

	console.log( result );
}).catch( function( err ) {

	console.log( err );
});

Keywords

FAQs

Last updated on 21 Oct 2014

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc