onebeyond/license-checker

View on GitHub
src/checker.js

Summary

Maintainability
A
0 mins
Test Coverage
F
57%
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
};