app-notify
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -1,3 +0,3 @@ | ||
var gulp = require('gulp'); | ||
var mocha = require('gulp-mocha'); | ||
const gulp = require('gulp'); | ||
const mocha = require('gulp-mocha'); | ||
@@ -4,0 +4,0 @@ gulp.task('default', ['test']); |
14
index.js
@@ -1,6 +0,6 @@ | ||
var Sms = require('./lib/sms'); | ||
var Email = require('./lib/email'); | ||
var _ = require('lodash'); | ||
var async = require('async'); | ||
var q = require('q'); | ||
const Sms = require('./lib/sms'); | ||
const Email = require('./lib/email'); | ||
const _ = require('lodash'); | ||
const async = require('async'); | ||
const q = require('q'); | ||
@@ -17,3 +17,3 @@ function Notify(cfg){ | ||
var notify = { | ||
const notify = { | ||
respondWithError: function(err, method){ | ||
@@ -38,3 +38,3 @@ if ( typeof method === 'function' ) { | ||
var method = !callback ? q.defer() : callback; | ||
const method = !callback ? q.defer() : callback; | ||
@@ -41,0 +41,0 @@ async.parallel([ |
@@ -1,4 +0,4 @@ | ||
var nodemailer = require('nodemailer'); | ||
var q = require('q'); | ||
var _ = require('lodash'); | ||
const nodemailer = require('nodemailer'); | ||
const q = require('q'); | ||
const _ = require('lodash'); | ||
@@ -13,3 +13,3 @@ function Email(cfg){ | ||
var email = { | ||
const email = { | ||
respondWithError: function(err, method){ | ||
@@ -32,4 +32,3 @@ if ( typeof method === 'function' ) { | ||
send: function (opts, cb){ | ||
var cfg = this.cfg; | ||
var method = !cb ? q.defer() : cb; | ||
const method = !cb ? q.defer() : cb; | ||
@@ -50,6 +49,6 @@ opts = _.merge(this.cfg, opts); | ||
var user = opts.smtp.user; | ||
var pass = opts.smtp.pass; | ||
var host = opts.smtp.host; | ||
var port = opts.smtp.port; | ||
const user = opts.smtp.user; | ||
const pass = opts.smtp.pass; | ||
const host = opts.smtp.host; | ||
const port = opts.smtp.port; | ||
@@ -70,3 +69,3 @@ if ( !user || !pass || !host || !port ) { | ||
var transporter = nodemailer.createTransport({ | ||
const transporter = nodemailer.createTransport({ | ||
host: host, | ||
@@ -81,3 +80,3 @@ port: port, | ||
var mailOptions = { | ||
const mailOptions = { | ||
from: opts.email.from, | ||
@@ -84,0 +83,0 @@ to: opts.email.to, |
@@ -1,3 +0,3 @@ | ||
var q = require('q'); | ||
var _ = require('lodash'); | ||
const q = require('q'); | ||
const _ = require('lodash'); | ||
@@ -12,3 +12,3 @@ function Sms(cfg){ | ||
var sms = { | ||
const sms = { | ||
respondWithError: function respondWithError(err, method){ | ||
@@ -31,4 +31,3 @@ if ( typeof method === 'function' ) { | ||
send: function send(opts, cb){ | ||
var cfg = this.cfg; | ||
var method = !cb ? q.defer() : cb; | ||
const method = !cb ? q.defer() : cb; | ||
@@ -42,4 +41,4 @@ opts = _.merge(this.cfg, opts); | ||
var sid = opts.sms.sid; | ||
var auth = opts.sms.auth; | ||
const sid = opts.sms.sid; | ||
const auth = opts.sms.auth; | ||
@@ -56,3 +55,3 @@ //check for required auth | ||
var client = require('twilio')(sid, auth); | ||
const client = require('twilio')(sid, auth); | ||
@@ -59,0 +58,0 @@ client.sendMessage({ |
{ | ||
"name": "app-notify", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Send SMS and email notifications from within your node.js app", | ||
@@ -23,19 +23,18 @@ "main": "index.js", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/chovy/app-notify/issues" | ||
}, | ||
"bugs": {}, | ||
"url": "https://github.com/chovy/app-notify/issues", | ||
"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" | ||
"async": "^3.1.0", | ||
"lodash": "^4.17.15", | ||
"nodemailer": "^6.3.0", | ||
"q": "^1.5.1", | ||
"twilio": "^3.35.1" | ||
}, | ||
"devDependencies": { | ||
"chai": "^1.10.0", | ||
"gulp": "^3.8.10", | ||
"gulp-mocha": "^2.0.0", | ||
"mocha": "^2.0.1" | ||
"chai": "^4.2.0", | ||
"gulp": "^3.x", | ||
"gulp-mocha": "^7.0.2", | ||
"mocha": "^6.2.1" | ||
} | ||
} |
app-notify | ||
========== | ||
Send SMS and email notifications from within your node.js app | ||
Send Twilio SMS and SMTP email notifications from within your node.js app | ||
@@ -13,5 +13,5 @@ # install | ||
```javascript | ||
var Notify = require('app-notify'); | ||
var cfg = {...}; | ||
var notify = new Notify(cfg); | ||
const Notify = require('app-notify'); | ||
const cfg = {...}; | ||
const notify = new Notify(cfg); | ||
``` | ||
@@ -24,3 +24,3 @@ | ||
```javascript | ||
var cfg = {}; | ||
const cfg = {}; | ||
@@ -41,4 +41,4 @@ //setup smtp server | ||
var Notify = require('app-notify'); | ||
var notify = new Notify(cfg); | ||
const Notify = require('app-notify'); | ||
const notify = new Notify(cfg); | ||
@@ -61,3 +61,3 @@ //send an email | ||
```javascript | ||
var cfg = {}; | ||
const cfg = {}; | ||
@@ -72,4 +72,4 @@ //setup sms configuration | ||
var Notify = require('app-notify'); | ||
var notify = new Notify(cfg); | ||
const Notify = require('app-notify'); | ||
const notify = new Notify(cfg); | ||
@@ -90,3 +90,3 @@ notify.sms({ | ||
```javascript | ||
var cfg = {}; | ||
const cfg = {}; | ||
@@ -107,4 +107,4 @@ //setup smtp server | ||
var Notify = require('app-notify'); | ||
var notify = new Notify(cfg); | ||
const Notify = require('app-notify'); | ||
const notify = new Notify(cfg); | ||
@@ -134,2 +134,2 @@ //sends both | ||
gulp test | ||
``` | ||
``` |
@@ -1,12 +0,12 @@ | ||
var Notify = require('../../index'); | ||
var expect = require('chai').expect; | ||
var config = require('../config'); | ||
var _ = require('lodash'); | ||
const Notify = require('../../index'); | ||
const expect = require('chai').expect; | ||
const config = require('../config'); | ||
const _ = require('lodash'); | ||
describe('All', function(){ | ||
var notify; | ||
let notify; | ||
describe('send', function(){ | ||
beforeEach(function() { | ||
var cfg = _.cloneDeep(config); | ||
const cfg = _.cloneDeep(config); | ||
notify = new Notify(cfg); | ||
@@ -13,0 +13,0 @@ }); |
@@ -1,12 +0,12 @@ | ||
var Notify = require('../../index'); | ||
var expect = require('chai').expect; | ||
var config = require('./../config'); | ||
var _ = require('lodash'); | ||
const Notify = require('../../index'); | ||
const expect = require('chai').expect; | ||
const config = require('./../config'); | ||
const _ = require('lodash'); | ||
describe('Email', function(){ | ||
describe('email', function(){ | ||
var notify; | ||
let notify; | ||
beforeEach(function() { | ||
var cfg = _.cloneDeep(config); | ||
const cfg = _.cloneDeep(config); | ||
notify = new Notify(cfg); | ||
@@ -13,0 +13,0 @@ }); |
@@ -1,11 +0,11 @@ | ||
var Notify = require('../../index'); | ||
var expect = require('chai').expect; | ||
var config = require('./../config'); | ||
var _ = require('lodash'); | ||
const Notify = require('../../index'); | ||
const expect = require('chai').expect; | ||
const config = require('./../config'); | ||
const _ = require('lodash'); | ||
describe('SMS', function(){ | ||
var notify; | ||
let notify; | ||
beforeEach(function() { | ||
var cfg = _.cloneDeep(config); | ||
const cfg = _.cloneDeep(config); | ||
notify = new Notify(cfg); | ||
@@ -12,0 +12,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16259
12
381
1
127
+ Addedagent-base@6.0.2(transitive)
+ Addedasap@2.0.6(transitive)
+ Addedasync@3.2.6(transitive)
+ Addedaxios@0.26.1(transitive)
+ Addedbuffer-equal-constant-time@1.0.1(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addeddayjs@1.11.13(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedecdsa-sig-formatter@1.0.11(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedjsonwebtoken@8.5.1(transitive)
+ Addedjwa@1.4.1(transitive)
+ Addedjws@3.2.2(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash.includes@4.3.0(transitive)
+ Addedlodash.isboolean@3.0.3(transitive)
+ Addedlodash.isinteger@4.0.4(transitive)
+ Addedlodash.isnumber@3.0.3(transitive)
+ Addedlodash.isplainobject@4.0.6(transitive)
+ Addedlodash.isstring@4.0.1(transitive)
+ Addedlodash.once@4.1.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addednodemailer@6.9.16(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedpop-iterate@1.0.1(transitive)
+ Addedq@2.0.3(transitive)
+ Addedqs@6.13.1(transitive)
+ Addedquerystringify@2.2.0(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedrootpath@0.1.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedscmp@2.1.0(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedtwilio@3.84.1(transitive)
+ Addedurl-parse@1.5.10(transitive)
+ Addedweak-map@1.0.8(transitive)
+ Addedxmlbuilder@13.0.2(transitive)
- Removedaddressparser@0.3.2(transitive)
- Removedasn1@0.1.11(transitive)
- Removedassert-plus@0.1.5(transitive)
- Removedasync@0.9.2(transitive)
- Removedaws-sign@0.3.0(transitive)
- Removedboom@0.4.2(transitive)
- Removedbuildmail@2.0.0(transitive)
- Removedclone@1.0.4(transitive)
- Removedcombined-stream@0.0.7(transitive)
- Removedcookie-jar@0.3.0(transitive)
- Removedcryptiles@0.2.2(transitive)
- Removedctype@0.5.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddelayed-stream@0.0.5(transitive)
- Removedforever-agent@0.5.2(transitive)
- Removedform-data@0.1.4(transitive)
- Removedhawk@1.0.0(transitive)
- Removedhoek@0.9.1(transitive)
- Removedhttp-signature@0.10.1(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjwt-simple@0.1.0(transitive)
- Removedlibbase64@0.1.0(transitive)
- Removedlibmime@1.2.0(transitive)
- Removedlibqp@1.1.0(transitive)
- Removedlodash@2.4.2(transitive)
- Removedmailcomposer@2.1.0(transitive)
- Removedmime@1.2.11(transitive)
- Removedms@2.0.0(transitive)
- Removedneedle@0.10.00.11.0(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removednodemailer@1.11.0(transitive)
- Removednodemailer-direct-transport@1.1.0(transitive)
- Removednodemailer-smtp-transport@1.1.0(transitive)
- Removednodemailer-wellknown@0.1.10(transitive)
- Removedoauth-sign@0.3.0(transitive)
- Removedq@0.9.7(transitive)
- Removedqs@0.6.6(transitive)
- Removedrequest@2.27.0(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedscmp@0.0.3(transitive)
- Removedsmtp-connection@1.3.8(transitive)
- Removedsntp@0.2.4(transitive)
- Removedtunnel-agent@0.3.0(transitive)
- Removedtwilio@1.11.1(transitive)
- Removedunderscore@1.13.7(transitive)
Updatedasync@^3.1.0
Updatedlodash@^4.17.15
Updatednodemailer@^6.3.0
Updatedq@^1.5.1
Updatedtwilio@^3.35.1