Skip to content

Commit eacbd97

Browse files
committed
Upgrading dependencies, adding promisified versions of functions
1 parent dbec7d4 commit eacbd97

File tree

4 files changed

+103
-258
lines changed

4 files changed

+103
-258
lines changed

lib/converter.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ var json2Csv = require('./json-2-csv'), // Require our json-2-csv code
44
csv2Json = require('./csv-2-json'), // Require our csv-2-json code
55
constants = require('./constants.json'), // Require in constants
66
docPath = require('doc-path'),
7-
_ = require('underscore'); // Require underscore
7+
promise = require('bluebird'),
8+
_ = require('underscore');
89

910
/**
1011
* Default options
@@ -63,7 +64,7 @@ var buildOptions = function (opts, cb) {
6364
};
6465

6566
// Export the following functions that will be client accessible
66-
module.exports = {
67+
var exports = {
6768

6869
/**
6970
* Client accessible json2csv function
@@ -116,3 +117,11 @@ module.exports = {
116117
});
117118
}
118119
};
120+
121+
// Promisified json2csv:
122+
exports.json2csvPromisified = promise.promisify(exports.json2csv);
123+
124+
// Promisified csv2json:
125+
exports.csv2jsonPromisified = promise.promisify(exports.csv2json);
126+
127+
module.exports = exports;

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "mrodrig",
33
"name": "json-2-csv",
44
"description": "A JSON to CSV and CSV to JSON converter that natively supports sub-documents and auto-generates the CSV heading.",
5-
"version": "2.1.2",
5+
"version": "2.2.0",
66
"repository": {
77
"type": "git",
88
"url": "http://github.com/mrodrig/json-2-csv.git"
@@ -25,14 +25,14 @@
2525
],
2626
"dependencies": {
2727
"underscore": "1.8.3",
28-
"doc-path": "1.2.0",
28+
"doc-path": "1.2.1",
2929
"bluebird": "3.5.1"
3030
},
3131
"devDependencies": {
32-
"mocha": "3.3.0",
32+
"mocha": "5.0.1",
3333
"istanbul": "0.4.5",
34-
"should": "13.1.2",
35-
"async": "2.5.0"
34+
"should": "13.2.1",
35+
"async": "2.6.0"
3636
},
3737
"engines": {
3838
"node": "*"

0 commit comments

Comments
 (0)