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.4 to 1.0.5

2

bin/opencollective-postinstall.js

@@ -37,2 +37,4 @@ #!/usr/bin/env node

if (process.env.DEBUG) console.log("process.env", process.env);
if (!npm_package_collective_url) {

@@ -39,0 +41,0 @@ setup();

@@ -22,5 +22,21 @@ const chalk = require('chalk');

const loadMainPackageJSON = function(attempts) {
attempts = attempts || 1;
if (attempts > 5) {
throw new Error('Can\'t resolve main package.json file');
}
var mainPath = attempts === 1 ? './' : Array(attempts).join("../");
try {
if (process.env.DEBUG) console.log("Trying to load package.json from", process.cwd(), mainPath + 'package.json');
return require.main.require(mainPath + 'package.json');
} catch (e) {
return loadMainPackageJSON(attempts + 1);
}
}
module.exports = {
padding,
formatCurrency
formatCurrency,
loadMainPackageJSON
};

2

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

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

const fs = require('fs');
const inquirer = require('inquirer');
const packageJSONFile = `${process.cwd()}/package.json`;
const package = require(packageJSONFile);
const { loadMainPackageJSON } = require('./lib/utils');
const { fetchLogo } = require('./lib/fetchData');
const { printLogo } = require('./lib/print');
const package = loadMainPackageJSON();
var questions = [

@@ -28,4 +29,3 @@ {

{ name: 'No logo', value: null }
],
default: true
]
},

@@ -32,0 +32,0 @@ {

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