众筹库opencollective-postinstall

在我们新建一个vue工程后(vue create xxxx),会有以下信息:

67 packages are looking for funding

  run `npm fund` for details

 

进入 xxx 目录后,运行npm fund 会有以下信息:

随便打开一下https://opencollective.com/core-js  就会看到这个是来众筹的。

据说vue作者尤大大,每年可众筹20W 美元,不用上班了。。。

那么如果你的项目中用到了一些库,感觉这个库不错,想邀请更多人对这个库进行支持,那么可以用这个库opencollective-postinstall 来邀请。这个库的说明如下:

Lightweight npm postinstall message to invite people to donate to your collective

使用方法如下:

1)npm i --save -dev opencollective-postinstall

2)在package.json中配置如下:

     

{
  "name": "open-collective-demo",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "postinstall": "opencollective-postinstall"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "vue": "^2.6.11"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "opencollective-postinstall": "^2.0.3",
    "vue-template-compiler": "^2.6.11"
  },
  "collective": {
    "url": "https://opencollective.com/webpack" //这个就是你要邀请众筹的项目
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

      3)运行npm run postinstall 就会看到众筹信息了

           

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值