parse-git-config
Advanced tools
Comparing version 2.0.1 to 2.0.2
22
index.js
@@ -12,9 +12,9 @@ /*! | ||
const path = require('path'); | ||
const util = require('util'); | ||
const ini = require('ini'); | ||
const configPath = require('git-config-path'); | ||
const expand = require('expand-tilde'); | ||
const read = util.promisify(fs.readFile); | ||
const stat = util.promisify(fs.stat); | ||
const read = promisify(fs.readFile); | ||
const stat = promisify(fs.stat); | ||
/** | ||
@@ -199,2 +199,18 @@ * Asynchronously parse a `.git/config` file. If only the callback is passed, | ||
/** | ||
* Wraps an arbitrary function in a Promise. | ||
* | ||
* @param {Function} `fn` The function to be wrapped. | ||
*/ | ||
function promisify(fn) { | ||
return (...args) => { | ||
return new Promise((resolve, reject) => { | ||
fn(...args, (err, res) => { | ||
err ? reject(err) : resolve(res); | ||
}); | ||
}); | ||
}; | ||
} | ||
/** | ||
* Expose `parse` | ||
@@ -201,0 +217,0 @@ */ |
{ | ||
"name": "parse-git-config", | ||
"description": "Parse `.git/config` into a JavaScript object. sync or async.", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"homepage": "https://github.com/jonschlinkert/parse-git-config", | ||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"contributors": [ | ||
"j. suárez (http://suarez.systems)", | ||
"Jon Schlinkert (http://twitter.com/jonschlinkert)", | ||
"Sam Holmes (https://samholmes.net)", | ||
"(https://github.com/js-n)" | ||
"Sam Holmes (https://samholmes.net)" | ||
], | ||
@@ -22,3 +22,3 @@ "repository": "jonschlinkert/parse-git-config", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=6" | ||
}, | ||
@@ -25,0 +25,0 @@ "scripts": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15637
185
1