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

opencollective-postinstall

Package Overview
Dependencies
Maintainers
2
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.1.1 to 2.0.0

index.js

38

package.json
{
"name": "opencollective-postinstall",
"version": "1.1.1",
"description": "Prompt users to donate after they install your node module with npm install",
"version": "2.0.0",
"description": "Lightweight npm postinstall message to invite people to donate to your collective",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/opencollective/opencollective-postinstall.git"
"url": "git+https://github.com/opencollective/npm-postinstall.git"
},
"scripts": {
"test": "mocha test",
"postinstall": "node bin/setup.js"
},
"bin": {
"opencollective-postinstall": "./bin/opencollective-postinstall"
},
"bin": "index.js",
"keywords": [
"opencollective",
"donate",
"donation",
"fundoss",
"npm"
"funding",
"sustain"
],
"author": "Xavier Damman <@xdamman>",
"author": "Xavier Damman (@xdamman)",
"license": "MIT",
"bugs": {
"url": "https://github.com/opencollective/node-module/issues"
"url": "https://github.com/opencollective/npm-postinstall/issues"
},
"homepage": "https://github.com/opencollective/node-module#readme",
"dependencies": {
"chalk": "1.1.3",
"node-fetch": "1.6.3",
"inquirer": "^3.0.6"
},
"devDependencies": {
"chai": "3.5.0",
"cross-env": "^4.0.0",
"mocha": "3.2.0"
}
"homepage": "https://github.com/opencollective/npm-postinstall#readme"
}

@@ -1,75 +0,25 @@

# opencollective-postinstall
Prompt your users to donate to your collective after `npm install`
# npm-postinstall
Lightweight npm postinstall message to invite people to donate to your collective
![](https://cl.ly/0u2a0z0Y3X37/Screen%20Shot%202017-03-24%20at%202.37.46%20PM.png)
## Installation
You can also add your ASCII art logo:
![](https://cl.ly/3u182e3B0323/Screen%20Shot%202017-03-14%20at%2010.51.21%20AM.png)
```
npm install --save opencollective-postinstall
```
## Install
And in your `package.json` add:
npm install opencollective-postinstall --save-dev
```json
{
...
"scripts": {
"postinstall": "opencollective-postinstall"
},
"collective": {
"url": "https://opencollective.com/webpack"
}
...
}
```
This will run an interactive cli to configure your package.json
Note: because you are adding this in your `devDependencies`, it will only be installed in development enviromnent.
![](https://cl.ly/2k0G1C461A09/Screen%20Shot%202017-03-14%20at%2010.53.36%20AM.png)
In your `package.json`, it will add a new `"collective"` attribute and update the postinstall script.
{
...
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/yourcollective_slug", // e.g. https://opencollective.com/webpack
"logo": "https://opencollective.com/webpack/logo.txt?variant=wide&width=26"
},
"scripts": {
"postinstall": "./node_modules/.bin/opencollective-postinstall || exit 0"
},
...
}
**Why `|| exit 0` in `scripts.postinstall`?**<br />
Since we are adding the dependency in `devDependencies`, the script `./node_modules/.bin/opencollective-postinstall` won't be installed in production. Therefore, the `postinstall` script will return an error and will interrupt the `npm install` process. Adding `|| exit 0` makes sure that this `postinstall` script always returns true.
## Options
### Customize the ASCII art logo of your collective
You can play with different sizes and variants to get the perfect ASCII art for your collective:
https://opencollective.com/:slug/logo.txt?variant=:string&width=:integer&reverse=:boolean
e.g. https://opencollective.com/webpack/logo.txt?variant=wide&width=26&reverse=false
Possible values for `variant`: `wide`, `ultra-wide`, `variant1`, `variant2`, `variant3`, `variant4`, `blocks`, `bits`, `binary`, `greyscale`, `solid`
You can also change `reverse` to `true`.
### Suggest a donation amount
You can specify a suggested donation amount or a different URL to use for your logo in ascii.
In the "collective" section of your `package.json`, add:
{
...
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/yourcollective_slug", // e.g. https://opencollective.com/webpack
"logo": "https://opencollective.com/yourcollective_slug/logo.txt" // e.g. https://opencollective.com/webpack/logo.txt
"suggested_donation": {
"amount": 2,
"currency": "USD", // must be same currency than your collective's default currency
"interval": "monthly" // or "one-time" or "yearly"
}
}
}
## Questions? Comments? Feedback?
Join the #opensource channel on our slack: https://slack.opencollective.org
Note: This is a lightweight alternative to the [opencollective-cli](https://github.com/opencollective/opencollective-cli) that offers a more complete postinstall message with the current balance and ASCII logo of the collective.

Sorry, the diff of this file is not supported yet

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