最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do I block advertising in npm? - Stack Overflow

programmeradmin3浏览0评论

When I run various npm mands, the console output is filled with ads for various projects and people. I'm a prolific open source contributor, but console output for a tool is not a good place for advertising.

Thank you for using core-js (  ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> 
> 

Also, the author of core-js (  ) is looking for a good job -)

...
...

Thank you for using husky!
If you rely on this package, please consider supporting our open collective:
> 

That's around 11 lines of output, colorised to grab my attention, when I'm looking for warnings or errors.

How do I block ads in npm?

When I run various npm mands, the console output is filled with ads for various projects and people. I'm a prolific open source contributor, but console output for a tool is not a good place for advertising.

Thank you for using core-js ( https://github./zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective./core-js
> https://www.patreon./zloirock

Also, the author of core-js ( https://github./zloirock ) is looking for a good job -)

...
...

Thank you for using husky!
If you rely on this package, please consider supporting our open collective:
> https://opencollective./husky/donate

That's around 11 lines of output, colorised to grab my attention, when I'm looking for warnings or errors.

How do I block ads in npm?

Share Improve this question edited May 12, 2020 at 16:08 mikemaccana asked Mar 17, 2020 at 13:01 mikemaccanamikemaccana 124k110 gold badges430 silver badges533 bronze badges 10
  • 1 I don't know the answer but have some good news for you infoq./news/2019/08/npm-bans-package-ads – Parth Raval Commented Mar 17, 2020 at 13:03
  • 1 I don't think there's anything native that would work for all NPM packages, NPM has banned this practice so maybe just report them? – Ryan McDonough Commented Mar 17, 2020 at 13:05
  • 4 How did somebody vote to close this as opinion-based? – Jared Smith Commented Mar 17, 2020 at 14:54
  • 2 @ParthRaval The packages (and the OPEN_SOURCE_CONTRIBUTOR environment variable mentioned) mentioned in your article would make for a good answer. – mikemaccana Commented Mar 17, 2020 at 15:10
  • 1 @ParthRaval - ditto what @mikemaccana suggests. You should change your ment into a formal answer. Even if you just quote the last two paragraphs from here it would suffice as a good answer. – RobC Commented Mar 18, 2020 at 9:46
 |  Show 5 more ments

2 Answers 2

Reset to default 6

You can remove ads using the funding package by adding an environment variable:

OPEN_SOURCE_CONTRIBUTOR=true

Some packages that use opencollective-postinstall need their own mand instead:

DISABLE_OPENCOLLECTIVE=true

for the opencollective

OPENCOLLECTIVE_HIDE=true

did the trick for me, more optins see https://github./nuxt/opencollective#disable-message for more disabling options

发布评论

评论列表(0)

  1. 暂无评论