Socket
Socket
Sign inDemoInstall

@nuxtjs/opencollective

Package Overview
Dependencies
14
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nuxtjs/opencollective

[![npm version][npm-v-src]][npm-v-href] [![npm downloads][npm-d-src]][npm-d-href] [![status][github-actions-src]][github-actions-href]


Version published
Weekly downloads
2.8M
increased by3.41%
Maintainers
5
Install size
397 kB
Created
Weekly downloads
 

Package description

What is @nuxtjs/opencollective?

The @nuxtjs/opencollective npm package is designed to encourage users of an open-source project to contribute to its collective fund. It displays a post-install message in the terminal, prompting users to donate to the project's Open Collective. This helps maintainers to sustain their work on the project by raising funds from users who find the project valuable.

What are @nuxtjs/opencollective's main functionalities?

Post-install donation prompt

Displays a message after `npm install` is run, encouraging users to support the project on Open Collective.

const { showPostInstallMessage } = require('@nuxtjs/opencollective');

// This function is typically called in a postinstall script in package.json
showPostInstallMessage();

Other packages similar to @nuxtjs/opencollective

Changelog

Source

0.3.2 (2020-10-13)

Bug Fixes

  • pkg: update main entry name (e70d401)

Readme

Source

@nuxt/opencollective 🤝 Pretty opencollective stats on postinstall!

npm version npm downloads status

Showcase

📖 Release Notes

Features

Displaying opencollective statistics and a donation URL after users install a package is important for many creators. After problems with current packages that offer similar features, we decided to spin off our one own. Our key goals are:

  • No interference/problems when installing packages. Never break installation because of the package
  • Pretty output for all information
  • Decent configurability
  • Seamless drop-in for common solutions

Setup

  • Add @nuxt/opencollective dependency using yarn or npm to your project
  • Add the script to postinstall in your package.json
{
  // ...
  "scripts": {
    "postinstall": "opencollective || exit 0"
  },
  "collective": {
    "url": "https://opencollective.com/nuxtjs"
  }
  // ...
}
  • Configure it

Configuration

Configuration is applied through your project's package.json.

A full configuration looks like:

{
  "collective": {
    "url": "https://opencollective.com/nuxtjs",
    "logoUrl": "https://opencollective.com/nuxtjs/logo.txt?reverse=true&variant=variant2",
    "donation": {
      "slug": "/order/591",
      "amount": "50",
      "text": "Please donate:"
    }
  }
}

AttributeOptionalDefaultComment
url-The URL to your opencollective page
logo-LEGACY: The URL to the logo that should be displayed. Please use logoUrl instead.
logoUrl-The URL to the ASCII-logo that should be displayed.
donation.slug'/donate'The slug that should be appended to url. Can be used to setup a specific order.
donation.amount-The default amount that should be selected on the opencollective page.
donation.text'Donate:'The text that will be displayed before your donation url.

Disable message

We know the postinstall messages can be annoying when deploying in production or running a CI pipeline. That's why the message is disabled in those environments by default.

Enabled when one the following environment variables is set:

  • NODE_ENV=dev
  • NODE_ENV=development
  • OPENCOLLECTIVE_FORCE

Strictly Disabled when one the following environment variables is set:

  • OC_POSTINSTALL_TEST
  • OPENCOLLECTIVE_HIDE
  • CI
  • CONTINUOUS_INTEGRATION
  • NODE_ENV (set and not dev or development)
  • DISABLE_OPENCOLLECTIVE (set to any string value that is not 'false' or '0', for compatability with opencollective-postinatall)

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Run it manually path/to/project/root/src/index.js path/to/package/you/want/to/try
  • Run tests with npm t or yarn test

Inspiration

This project is heavily inspired by opencollective-cli.

License

MIT License MIT. Made with 💖

FAQs

Last updated on 04 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc