Monetize publicly published packages

This idea initially started thanks to DEV X GFTW hackathon.
I am more of a JavaScript developer so many of the references will be made to that ecosystem, although the problem and solution is universal

The Problem

There is no existing way to monetize publicly published packages ( Think npm / pip )

Proposed Solution

Build a layer that sends the payment to the packages being used.


There are thousands of unmaintained packages present in npm registry, which get abandoned either due to low popularity and low contribution by the community, or because the developer is not being payed for their work, which makes them lose interest in further development.

When I first came across Web Monetization, I thought it would be the perfect solution for this problem, as the packages being used can be paid constantly as long as the app is being used. It could be made compulsory that deployed servers or corporate use has to monetize the packages.

I had this idea while making my submission for the hackathon, and I made a proof of concept for this, which you can find here

I made a CLI that wraps your node application and monetizes all the packages it is using by looking into the package.json file and finding the packages which support Web Monetization. How it’s done is all written in the post linked above.

Quoting the blog, somewhat specific to node environment, how is this better than already existing methods like npm fund

You may have this question in your head ever since you opened this post. Well we all have seen the npm fund prompt pop while installing any package that supports it. What most of us haven’t done is try to run this command and go the links that are provided, after which you have to perform further digging to find out how to pay and support the developer, which makes for a bad experience, one that can make a person willing to pay opt out.
Well this changes that. The amount of steps reduce to just installing this package globally, logging in to your provider only once, and just running the app using it.

Some other good changes this can bring

  1. Active development of more packages as developers are being paid for their hobbies.
  2. Careful installation of packages and prevention of installation of unnecessary packages.
  3. More thought on dependency cycle as if two not compatible enough versions of the same packages are listed as dependencies, they could end up being installed twice thus getting monetized twice.

I think this is a really neat solution, and if in the near future a provider comes up with an API which can allow payments, this would become even better. Right now I am using a hacky way by using puppeteer to monetize packages using the coil extension.

I wanted to refine this even more, and know if it a good idea at all.

If this seems viable and a good approach, I still won’t be able to submit a proposal this time as I have placements over my head and won’t be able to guarantee my time right now, but I would certainly like to use this time to refine this idea more and get some feedback.