opencollective-postinstall
Advanced tools
Comparing version 1.0.8 to 1.0.9
#!/usr/bin/env node | ||
const fs = require('fs'); | ||
const { padding } = require('../lib/utils'); | ||
const { debug, padding } = require('../lib/utils'); | ||
const { fetchStats, fetchLogo } = require('../lib/fetchData'); | ||
const { printLogo, printFooter, printStats } = require('../lib/print'); | ||
const setup = require('../setup'); | ||
@@ -37,7 +36,5 @@ const { | ||
if (process.env.DEBUG) console.log("process.env", process.env); | ||
debug("process.env", process.env); | ||
if (!npm_package_collective_url) { | ||
setup(); | ||
} else if (npm_lifecycle_event !== 'postinstall') { | ||
if (npm_lifecycle_event !== 'postinstall') { | ||
console.error(`This script should be run as a postinstall script. Please add it to your package.json.`); | ||
@@ -51,4 +48,4 @@ console.log(`e.g.:`); | ||
return process.exit(0); | ||
} else { | ||
} else if (npm_package_collective_url) { | ||
init(); | ||
} |
const chalk = require('chalk'); | ||
const debug = function() { | ||
if (process.env.DEBUG && process.env.DEBUG.match(/postinstall/i)) { | ||
console.log.apply(this, arguments); | ||
} | ||
} | ||
const padding = function(length) { | ||
@@ -23,4 +29,5 @@ let padding = ''; | ||
module.exports = { | ||
debug, | ||
padding, | ||
formatCurrency | ||
}; |
{ | ||
"name": "opencollective-postinstall", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Prompt users to donate after they install your node module with npm install", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"postinstall": "./bin/opencollective-postinstall.js" | ||
"postinstall": "./bin/setup.js" | ||
}, | ||
@@ -15,0 +15,0 @@ "bin": { |
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
14587
263
8