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

google-home-module

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

google-home-module

This module is for doing all the things the Google Home website can do!

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-90%
Maintainers
1
Weekly downloads
 
Created
Source

Google Home Module

Logo

npm npm install size Lines of code Website

This module includes everything of Google Home!

Table of Contents

  1. Website & Documentation URL
    1. Website
    2. Documentation
  2. Installation
  3. Usage
    1. Weather
  4. Commands
    1. Variables
    2. Methods
    3. Classes

Website & Documentation URL

Website

See the website at https://arnavthorat78.github.io/Google-Home/.

Documentation

See the website at https://arnavthorat78.github.io/Google-Home/developer.html.

Installation

npm install google-home-module

It's that easy!

To then use it in your project, simple require it.

const googleHome = require("google-home-module");

Usage

Popular only! We only have the popular variables, methods and classes. Sorry for any inconvenience caused by this.

Weather

To get the weather, you can use the getWeather method, as described below. It returns a Promise with the data. Please note that the data is by default parsed.

googleHome
	.getWeather(
		"metric", // units: string
		"Melbourne", // city: string
		"VIC", // stateCode?: string
		"AUS" // countryCode?: string
	)
	.then((data) => {
		console.log(`In ${data.name}, it is ${data.temp.toFixed(1)} degrees Celcius.`);
	})
	.catch((err) => {
		console.log(err);
	});

This outputs...

In Melbourne, it is 20.2 degrees Celcius.

With the weather data, we can change some values that are non-human readable, and also add some values. The changeWeatherData method helps us with that.

googleHome
	.getWeather("metric", "Melbourne", "VIC", "AUS")
	.then((data) => {
		console.log(
			googleHome.changeWeatherData(
				data.weather[0].icon, // icon: string
				data.sys.sunrise, // sunrise: number
				data.sys.sunset // sunset: number
			)
		);
	})
	.catch((err) => {
		console.log(err);
	});

This should output something like this, depending on your data.

{
	"http://openweathermap.org/img/wn/03d@2x.png",
	"day",
	'readable-sunrise-date',
	'readable-sunset-date'
}
More are coming soon!

Commands

Variables
CommandsDescription
websiteVersion: stringDeprecated! Get the website version of the Google Home website.
version: stringDeprecated! Get the version of the Google Home Module NPM module.
keyboardShortcuts: { openHome: { definition: string, shortcut: string, ...more }, ...more }Get all of the keyboard shortcuts and the information from the website!
Methods
CommandsDescription
randomGreeting: (signedIn: boolean, username?: string) => stringGet a random greeting for the user.
getWeather: (units: string, city: string, stateCode?: string, countryCode?: string) => Promise<object>Get the weather for your location chosen.
changeWeatherData: (icon: string, sunrise: number, sunset: number) => { icon: string; dayNight: string; sunrise: string; sunset: string; }Change the format of the weather data retrieved with the getWeather method.
Classes
CommandsDescription
BasicSearch(query: string, searchEngine?: string): BasicSearchMake a new BasicSearch so the user can search with their desired search engine.
URLSearch(url: string): URLSearchMake a new URLSearch for a user to use.
SmartSearch(command: string): SmartSearchMake a new SmartSearch for a user to interact with.
User(displayName: string, email: string, password: string, exists?: boolean, admin?: boolean, signedOut?: boolean): UserMake a new User for a user's account.

Keywords

FAQs

Package last updated on 22 Sep 2021

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