Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npcheck

Package Overview
Dependencies
Maintainers
5
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npcheck - npm Package Compare versions

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 });
}
});

2

package.json
{
"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;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc