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

node-pushover

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pushover

node.js pushover module for https://pushover.net/api

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
181
decreased by-20.61%
Maintainers
2
Weekly downloads
 
Created
Source

node-pushover

node.js pushover module for https://pushover.net/api

Install

You can install node-pushover using the Node Package Manager (npm):

npm install node-pushover

Initialization

new Pushover({ token: "APPTOKEN" [, user: "USERKEY"]});

Initializes a Pushover object with the APPTOKEN and optionally a USERKEY . The USERKEY can also be given when sending the messages.

Sending messages

push.send([USERKEY,] title, message [,callback])

Arguments

  • USERKEY: (optional) The USERKEY as given to you by the Pushover API.
  • title: The title for your message
  • message: The content for your message
  • callback(err, res): (optional) A callback function which is called when the message is send.

Example with the USERKEY given at initialisation

var Pushover = require('node-pushover');
var push = new Pushover({
	token: "APPTOKEN",
	user: "USERKEY"
});

// No callback function defined:
push.send("Some title", "Node.js is Cool!! - no callback");

// A callback function is defined:
push.send("Some title", "Node.js is Cool!!", function (err, res){
	if(err){
		console.log("We have an error:");
		console.log(err);
		console.log(err.stack);
	}else{
		console.log("Message send successfully");
		console.log(res);
	}
});

Example with the USERKEY given when the message is send

var Pushover = require('node-pushover');
var push = new Pushover({
	token: "APPTOKEN"
});

// No callback function defined:
push.send("USERKEY", "Some title", "Node.js is Cool!! - no callback");

// A callback function is defined:
push.send("USERKEY", "Some title", "Node.js is Cool!!", function (err, res){
	if(err){
		console.log("We have an error:");
		console.log(err);
		console.log(err.stack);
	}else{
		console.log("Message send successfully");
		console.log(res);
	}
});

FAQs

Package last updated on 12 Feb 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