# @nuxt/opencollective

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

Latest version **0.4.1** (published 2024-12-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nuxt/opencollective
pnpm add @nuxt/opencollective
yarn add @nuxt/opencollective
bun add @nuxt/opencollective
```

Provides the command `opencollective`.

## Health

**Score 40/100 (D)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.4.1 |
| Published | 2024-12-12 |
| First published | 2018-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^14.18.0 \|\| >=16.10.0 |
| Dependencies | 1 |
| Unpacked size | 18.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Maintainers | atinux, pi0, antfu, danielroe, nuxtbot |

## Links

- npm: https://www.npmjs.com/package/@nuxt/opencollective
- Repository: https://github.com/nuxt-contrib/opencollective
- Homepage: https://github.com/nuxt-contrib/opencollective#readme
- Issues: https://github.com/nuxt-contrib/opencollective/issues
- npm.io page: https://npm.io/package/@nuxt/opencollective

## Dependencies (1)

- [consola](https://npm.io/package/consola.md) ^3.2.3

## Recent versions

- 0.4.1 (latest) — 2024-12-12
- 0.4.0 — 2023-11-17
- 0.3.3 — 2022-05-18
- 0.3.2 — 2020-10-13
- 0.3.1 — 2020-10-13
- 0.3.0 — 2019-08-26
- 0.2.2 — 2019-04-02
- 0.2.1 — 2018-12-12
- 0.2.0 — 2018-11-25

## README

# @nuxtjs/opencollective 🤝 Pretty opencollective stats on postinstall!
[![npm version][npm-v-src]][npm-v-href]
[![npm downloads][npm-d-src]][npm-d-href]
[![status][github-actions-src]][github-actions-href]

![Showcase](https://i.imgur.com/PZqyT3x.jpg)

>

[📖 **Release Notes**](./CHANGELOG.md)

## 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](https://github.com/opencollective/opencollective-cli) [solutions](https://github.com/opencollective/opencollective-postinstall)

## Setup

- Add `@nuxtjs/opencollective` dependency using yarn or npm to your project
- Add the script to `postinstall` in your package.json

```js
{
  // ...
  "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:

```json
{
  "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:"
    }
  }
}
```

---

| Attribute | Optional | Default | Comment |
| ---    |   ---   | ---   | --- |
| 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 compatibility with
  [opencollective-postinstall](https://github.com/opencollective/opencollective-postinstall))

## Development

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

## Inspiration

This project is heavily inspired by [opencollective-cli](https://github.com/opencollective/opencollective-cli).

## License

[MIT License](./LICENSE)
MIT. Made with 💖

<!-- Refs -->
[npm-v-src]: https://img.shields.io/npm/v/@nuxtjs/opencollective?style=flat-square
[npm-v-href]: https://npmjs.com/package/@nuxtjs/opencollective

[npm-d-src]: https://img.shields.io/npm/dm/@nuxtjs/opencollective?style=flat-square
[npm-d-href]: https://npmjs.com/package/@nuxtjs/opencollective

[github-actions-src]: https://img.shields.io/github/workflow/status/nuxt-contrib/opencollective/ci/main?style=flat-square
[github-actions-href]: https://github.com/nuxt-contrib/opencollective/actions?query=workflow%3Aci

---
_Source: https://npm.io/package/@nuxt/opencollective · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
