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

opencollective-postinstall

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opencollective-postinstall - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

19

bin/opencollective-postinstall.js

@@ -9,23 +9,7 @@ #!/usr/bin/env node

const {
npm_package_name,
npm_package_collective_url,
npm_package_collective_logo,
npm_package_collective_suggested_donation_amount,
npm_package_collective_suggested_donation_interval,
npm_lifecycle_event,
npm_config_user_agent
npm_lifecycle_event
} = process.env;
function getDonateURL() {
let donate_url = npm_package_collective_url;
if (npm_package_collective_suggested_donation_amount) {
donate_url += `/donate/${npm_package_collective_suggested_donation_amount}`;
if (npm_package_collective_suggested_donation_interval) {
donate_url += `/${npm_package_collective_suggested_donation_interval}`;
}
donate_url += (npm_config_user_agent.match(/yarn/)) ? '/yarn' : '/npm';
}
return donate_url;
}
function init() {

@@ -66,4 +50,3 @@ const promises = [];

} else {
console.log("init");
init();
}

20

lib/print.js

@@ -5,2 +5,22 @@ const execSync = require('child_process').execSync;

const {
npm_package_name,
npm_package_collective_url,
npm_package_collective_suggested_donation_amount,
npm_package_collective_suggested_donation_interval,
npm_config_user_agent
} = process.env;
function getDonateURL() {
let donate_url = npm_package_collective_url;
if (npm_package_collective_suggested_donation_amount) {
donate_url += `/donate/${npm_package_collective_suggested_donation_amount}`;
if (npm_package_collective_suggested_donation_interval) {
donate_url += `/${npm_package_collective_suggested_donation_interval}`;
}
donate_url += (npm_config_user_agent.match(/yarn/)) ? '/yarn' : '/npm';
}
return donate_url;
}
const print = function(str, opts = { color: null, align: 'center'}) {

@@ -7,0 +27,0 @@ opts.align = opts.align || 'center';

{
"name": "opencollective-postinstall",
"version": "1.0.3",
"version": "1.0.4",
"description": "Prompt users to donate after they install your node module with npm install",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -60,3 +60,3 @@ const fs = require('fs');

let postinstall = "./node_modules/.bin/opencollective-postinstall";
if (package.scripts.postinstall) {
if (package.scripts.postinstall && package.scripts.postinstall.indexOf(postinstall) === -1) {
package.scripts.postinstall = `${package.scripts.postinstall} && ${postinstall}`;

@@ -63,0 +63,0 @@ } else {

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