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

app-notify

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-notify - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

.editorconfig

17

package.json
{
"name": "app-notify",
"version": "1.0.0",
"version": "1.1.0",
"description": "Send SMS and email notifications from within your node.js app",

@@ -26,3 +26,16 @@ "main": "index.js",

},
"homepage": "https://github.com/chovy/app-notify"
"homepage": "https://github.com/chovy/app-notify",
"dependencies": {
"async": "^0.9.0",
"lodash": "^2.4.1",
"nodemailer": "^1.3.0",
"q": "^1.1.2",
"twilio": "^1.10.0"
},
"devDependencies": {
"chai": "^1.10.0",
"gulp": "^3.8.10",
"gulp-mocha": "^2.0.0",
"mocha": "^2.0.1"
}
}

@@ -5,1 +5,92 @@ app-notify

Send SMS and email notifications from within your node.js app
# usage (promises)
Send an email message:
//setup smtp server
var smtp = {
host: xxx,
user: user,
pass: pass,
port: port
};
//setup email headers
var email = {
to: user@example.com,
from: sender@example.com'
};
var notify = require('app-notify');
//set your configuration
notify.cfg.email = email;
notify.cfg.smtp = smtp;
//send an email
notify.email({
subject: 'This is a test',
message: 'Hello world!'
})
.then(function(data){
console.log(data);
})
.catch(function(err){
console.error(err);
});
Send an SMS message
//setup sms configuration
var sms = {
sid: twilio-sid-id,
auth: twilio-auth-id,
to: xxx-xxx-xxxx, //recipient
from: yyy-yyy-yyyy //your twilio assigned phone number
};
var notify = require('app-notify');
//set your configuration
notify.cfg.sms = sms;
notify.sms({
message: 'Hello world'
})
.then(function(data){
console.log(data);
})
.catch(function(err){
console.error(err);
});
Send to whichever services we have enabled (both sms and email):
var notify = require('app-notify');
//set your configuration
notify.cfg.email = email;
notify.cfg.smtp = smtp;
notify.cfg.sms = sms;
//sends both
notify.send({
subject: 'This is a test',
message: 'Hello world'
});
notify.cfg.email.disabled = true;
//sends only sms
notify.send({
message: 'Hello world',
});
# usage (callbacks)
app-notify can be used with callbacks too!
# run tests
gulp test
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