nsq-publisher
Advanced tools
Comparing version 0.0.3 to 0.0.4
15
index.js
@@ -12,2 +12,8 @@ const Promise = require('bluebird'); | ||
createTopicAsync() { | ||
return request.postAsync( | ||
`${this.dataUrl}:${this.dataPort}/topic/create?topic=${this.topic}` | ||
); | ||
} | ||
createTopic(callback) { | ||
@@ -21,2 +27,11 @@ request.postAsync( | ||
publishAsync(message) { | ||
return new Promise((res, rej) => { | ||
this.publish(message, (err) => { | ||
if (err) { rej(err); } | ||
else { res(); } | ||
}); | ||
}); | ||
} | ||
publish(message, callback) { | ||
@@ -23,0 +38,0 @@ |
{ | ||
"name": "nsq-publisher", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Simple way to create topics and publish messages in NSQ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
10004
46