Comparing version 0.1.2 to 0.1.3
14
index.js
#! /usr/bin/env node | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const yargs = require('yargs'); | ||
const cli = require('./src/cli'); | ||
@@ -15,5 +18,12 @@ | ||
options.githubToken = | ||
options['github-token'] || process.env.GITHUB_TOKEN || null; | ||
options.githubToken = options['github-token'] || process.env.GITHUB_TOKEN; | ||
cli.run(options); | ||
// On uncaughtException we should clean the npcheck-env directory | ||
process.on('uncaughtException', () => { | ||
const envDirectory = path.resolve(process.cwd(), 'npcheck-env'); | ||
if (fs.existsSync(envDirectory)) { | ||
fs.rmdirSync(envDirectory, { recursive: true }); | ||
} | ||
}); |
{ | ||
"name": "npcheck", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A tool to run various checks on npm modules", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -13,3 +13,3 @@ const axios = require('axios'); | ||
headers: { | ||
Authorization: token || '' | ||
Authorization: token ? `token ${token}` : '' | ||
} | ||
@@ -16,0 +16,0 @@ }; |
@@ -5,3 +5,3 @@ const { error } = require('../lib/result'); | ||
module.exports = async (module, _, options) => { | ||
const archivePlugin = async (module, _, options) => { | ||
const githubTarget = module.repository.url | ||
@@ -27,1 +27,3 @@ .split('github.com/')[1] | ||
}; | ||
module.exports = archivePlugin; |
const { error } = require('../lib/result'); | ||
const { stringBuilder, success, failure } = require('../lib/format'); | ||
module.exports = async (module) => { | ||
const deprecationPlugin = async (module) => { | ||
const output = stringBuilder( | ||
@@ -21,1 +21,3 @@ "\nChecking if it's deprecated on NPM" | ||
}; | ||
module.exports = deprecationPlugin; |
const { stringBuilder, success, failure } = require('../lib/format'); | ||
const { error } = require('../lib/result'); | ||
module.exports = async (module, config) => { | ||
const licenses = config?.licenses?.allow || []; | ||
const licensePlugin = async (module, config) => { | ||
const licenses = config.licenses?.allow || []; | ||
const isLicenseAllowed = licenses.find((name) => name === module?.license); | ||
@@ -20,1 +20,3 @@ | ||
}; | ||
module.exports = licensePlugin; |
@@ -14,3 +14,3 @@ const { execSync } = require('child_process'); | ||
module.exports = async (module, config) => { | ||
const licenseTreePlugin = async (module, config) => { | ||
const envFolderPath = path.resolve(process.cwd(), 'npcheck-env'); | ||
@@ -46,3 +46,3 @@ fs.mkdirSync(envFolderPath); | ||
const licenses = config.licenses?.allow || []; | ||
const licensesSpecific = config.licenses.rules[module.name]?.allow || []; | ||
const licensesSpecific = config.licenses?.rules[module.name]?.allow || []; | ||
@@ -87,1 +87,3 @@ const licensePass = licenses.find((name) => name === value.licenses); | ||
}; | ||
module.exports = licenseTreePlugin; |
@@ -9,3 +9,3 @@ const R = require('ramda'); | ||
module.exports = async (module, _, options) => { | ||
const maintenancePlugin = async (module, _, options) => { | ||
const githubTarget = module.repository.url | ||
@@ -44,1 +44,3 @@ .split('github.com/')[1] | ||
}; | ||
module.exports = maintenancePlugin; |
@@ -11,3 +11,3 @@ const R = require('ramda'); | ||
module.exports = async (module, _, options) => { | ||
const testsPlugin = async (module, _, options) => { | ||
// Find npm test script (if exists) | ||
@@ -71,1 +71,3 @@ const npmScripts = module.scripts || []; | ||
}; | ||
module.exports = testsPlugin; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17076
402
5