Skip to content

Commit af3c021

Browse files
author
ehennum
committed
#551 remove Bluebird dependency in favor of native JavaScript Promises
1 parent 2368162 commit af3c021

File tree

5 files changed

+5
-32
lines changed

5 files changed

+5
-32
lines changed

examples/before-load.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
var fs = require('fs');
17-
var PromisePlus = require('../lib/bluebird-plus.js');
1817

1918
var marklogic = require('../');
2019

@@ -35,7 +34,7 @@ var collections = ['/countries', '/facts/geographic'];
3534
function readFile(filenames, i, buffer, isLast) {
3635
var filename = filenames[i];
3736

38-
files.push(new PromisePlus((resolve, reject) => {
37+
files.push(new Promise((resolve, reject) => {
3938
fs.readFile(fsdir+filename, function (err, content) {
4039
if (err) {
4140
throw err;
@@ -52,7 +51,7 @@ function readFile(filenames, i, buffer, isLast) {
5251
}));
5352

5453
if (isLast) {
55-
PromisePlus.all(files).then(function(documents) {
54+
Promise.all(files).then(function(documents) {
5655
console.log('loading batch from '+documents[0].uri+' to '+filename);
5756
db.documents.write(documents).result(function(response) {
5857
console.log(

lib/bluebird-plus.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

lib/responder.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ var concatStream = require('concat-stream');
1818
var jsonParser = require('json-text-sequence').parser;
1919
var Dicer = require('dicer');
2020
var through2 = require('through2');
21-
var PromisePlus = require('./bluebird-plus.js');
2221
var mlutil = require('./mlutil.js');
2322

2423
/**
@@ -1017,7 +1016,7 @@ function operationResultPromise(fullfilled, rejected) {
10171016
}
10181017
operation.outputMode = 'promise';
10191018

1020-
var promise = new PromisePlus(function promiseDispatcher(resolve, reject) {
1019+
var promise = new Promise(function promiseDispatcher(resolve, reject) {
10211020
if (operation.done !== true) {
10221021
if (resolve) {
10231022
operation.resolve = resolve;

npm-shrinkwrap.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"xpath"
2727
],
2828
"dependencies": {
29-
"bluebird": "^3.7.2",
3029
"concat-stream": "^2.0.0",
3130
"deepcopy": "^2.0.0",
3231
"dicer": "^0.3.0",

0 commit comments

Comments
 (0)