DEV Community

Cover image for monetize-files
Aditya Mitra
Aditya Mitra

Posted on

monetize-files

What I built

Web Monetization is really cool.
I came up with an idea that how existing content creators could add web-monetization to all their websites/projects.

Adding the monetization meta tag is simple, but it can be tiring to add it one-by-one to all your projects and webpages by opening them and add the tag.

With the monetize-files command-line tool, you can do it in just one simple command.


npm install -g monetize-files
cd your_project
monetize-files -w 'wallet address

Really, that's it!
monetize-files will figure out the html files by default and add that monetization meta tag to that file. You can also use other filetypes like pug or ejs if you want.

Submission Category:

monetize-files falls into the category of Foundational technology.

Demo

working

That's it to quickly get started with monetize-files.

If you want you can customize

  • which filetype will it monetize
  • which folder and its contents will it exclude from being monetized
  • run it as dev-dependency for your project instead of a global dependency

All of these customization can be found here on the github repo.
Go on have a look ;)

Link to Code

The code for this tool can be found here on GitHub:

GitHub logo aditya-mitra / monetize-files

CLI tool to web-monetize files

monetize-files

monetize-files is a CLI tool that helps you add web monetization tags It adds the monetization meta tag to all the files (of the desired extension) within the selected folder and its subfolders.

Installation

To get monetize-files in your system, you may use and configure it as a global package:

npm install -g monetize-files

You can also add it as a dev-dependency to your project (but this may require you to add the monetize script to your package.json)

npm install --save-dev monetize-files

Usage

To get a quick help at the command line for the monetize-files CLI tool, you can execute monetize-files -h

It will show you a list of options that you can pass as arguments to the CLI tool

help image

Quickstart

Once you are inside the folder where you want to web-monetize your desired files, you execute monetize-files -w 'your wallet address'

This will simply add the…

All contributions are welcome! :D

If you find a issue, you can submit the issue on this repo or simply by clicking here

How I built it

I have used JavaScript entirely to built this simple CLI tool.
However, my package has one dependency on yargs.

Basically, monetize-files takes input from the command line through yargs, figures out the files and directories to be scanned using and makes changes to these files using fs.

Additional Resources/Info

The tool can be found here on npmjs.

I really enjoyed building this and liked this hackathon. ;D

Top comments (0)