Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-fauxmo

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-fauxmo

Make fake WeMo devices. Another Node.JS port of fauxmo, borrowing heavily from fauxmojs

  • 0.0.4
  • Source
  • npm
  • Socket score

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

node-fauxmo

Make fake WeMo devices! Another Node.JS port of fauxmo, borrowing heavily from fauxmojs. This library gives you the ability to easily control anything you'd like from your Alexa enabled devices. You can control an array of relays from a raspberry pi or even start, stop, and get the status of a service on your computer. I've added the ability to get the status of a "fake device" from an external source. Enjoy!

Installation

npm install node-fauxmo

Usage

This example demonstrates the creation of 4 fake devices. The fourth uses the optional "statusHandler" method allowing the fake device to query other sources for it's status.

'use strict';

const FauxMo = require('node-fauxmo');

var dev4status = 0;

var dev4statushandler = function() {
	return dev4status;
}

var dev4handler = function(action) {
	dev4status = action;
}

let fauxMo = new FauxMo(
{
	devices: [{
		name: 'Fake Device 1',
		port: 11000,
		handler: function(action) {
			console.log('Fake Device 1:', action);
		}
	},
	{
		name: 'Fake Device 2',
		port: 11001,
		handler: function(action) {
			console.log('Fake Device 2:', action);
		}
	},
	{
		name: 'Fake Device 3',
		port: 11002,
		handler: function(action) {
			console.log('Fake Device 3:', action);
		}
	},
	{
		name: 'Fake Device 4',
		port: 11003,
		handler: function(action) {
			console.log('Fake Device 4:', action);
			dev4handler(action);
		},
		statusHandler: function(callback) {
			callback(dev4statushandler());
		}
	}
	]
});

Keywords

FAQs

Package last updated on 12 Jan 2019

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