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.12 to 1.0.13

30

bin/setup.js
#!/usr/bin/env node
const utils = require('../lib/utils');
const debug = utils.debug;
// Only run in development environment
if (process.env.NODE_ENV && process.env.NODE_ENV !== 'dev' && process.env.NODE_ENV !== 'development') {
debug("Wrong environment", process.env.NODE_ENV);
process.exit(0);
}
// In some CI environment, NODE_ENV might not be defined.

@@ -12,14 +17,18 @@ // We exit if `inquirer` module is not installed

} catch(e) {
debug("Can't find inquirer module, exiting");
process.exit(0);
}
const inquirer = require('inquirer');
if (typeof inquirer.prompt([]).then !== 'function') {
debug("Wrong version of inquirer, exiting");
process.exit(0);
}
const fs = require('fs');
const inquirer = require('inquirer');
const fetchData = require('../lib/fetchData');
const print = require('../lib/print');
const utils = require('../lib/utils');
const fetchLogo = fetchData.fetchLogo;
const printLogo = print.printLogo;
const debug = utils.debug;

@@ -29,4 +38,4 @@ const parentDir = process.cwd().split('/').slice(-2, -1)[0];

// No need to run the setup in standalone mode
debug("parent dir", parentDir);
debug("cwd", process.cwd());
debug(`Parent dir (${parentDir}) is not "node_modules", exiting`);
debug("Current dir (cwd):", process.cwd());
process.exit(0);

@@ -39,2 +48,3 @@ }

package = JSON.parse(fs.readFileSync(projectPackageJSON, 'utf8'));
debug(`package.json successfully loaded for ${package.name}`);
} catch(e) {

@@ -120,2 +130,6 @@ debug(`Unable to load ${process.cwd()}/${projectPackageJSON}`, e);

return process.exit(0);
})
.catch(e => {
debug("Error while running the prompt", e);
process.exit(0);
});

@@ -127,2 +141,6 @@ }

.then(printLogo)
.then(askQuestions);
.then(askQuestions)
.catch(e => {
debug("Error while trying to fetch the open collective logo or running the prompt", e);
process.exit(0)
});

6

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

@@ -32,7 +32,5 @@ "main": "index.js",

"chalk": "1.1.3",
"node-fetch": "1.6.3"
},
"devDependencies": {
"node-fetch": "1.6.3",
"inquirer": "^3.0.6"
}
}
# opencollective-postinstall
Prompt your users to donate to your collective after `npm install`
![](https://cl.ly/0u2a0z0Y3X37/Screen%20Shot%202017-03-24%20at%202.37.46%20PM.png)
You can also add your ASCII art logo:
![](https://cl.ly/3u182e3B0323/Screen%20Shot%202017-03-14%20at%2010.51.21%20AM.png)

@@ -5,0 +8,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