Skip to content

Commit

Permalink
feat: wrap license-check in promise
Browse files Browse the repository at this point in the history
  • Loading branch information
neodmy committed Aug 31, 2022
1 parent dffba92 commit 2d8a5b6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/checker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const checker = require('license-checker');

const parsePackages = path => new Promise((resolve, reject) => {
checker.init({
start: path
}, (error, packages) => {
if (error) reject(new Error(`'license-checker error: ${error}`));
else resolve(packages);
});
});

module.exports = {
parsePackages
};

0 comments on commit 2d8a5b6

Please sign in to comment.