The JavaScript Automations That Turned My Side Projects Into Passive Income Machines
1. The Day I Realized JavaScript Could Be My Cash Cow I always thought of JavaScript as just the thing that makes websites interactive. But then I built my first browser automation that collected market data for me, and it hit me — this wasn’t just code, it was a money-making engine. The key was finding repeatable tasks that people would pay to have done faster and turning them into automated JS scripts.
2. Puppeteer — My Secret Weapon for Browser Automation Puppeteer lets you control Chrome programmatically. Imagine clicking, typing, and scraping data like a human — but 1,000 times faster.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://example.com/products');
const products = await page.evaluate(() => {
return [...document.querySelectorAll('.product')].map(item => ({
name: item.querySelector('.title').innerText,
price: item.querySelector('.price').innerText
}));
});
console.log(products);
await browser.close();
})();
I used this for price monitoring scripts that I sold to small e-commerce stores.
3. Node.js + Cheerio — Web Scraping Without the Browser Sometimes you don’t need a full browser; you just need the HTML. That’s where Cheerio comes in.
const axios = require('axios');
const cheerio = require('cheerio');
(async () => {
const { data } = await axios.get('https://example.com/blog');
const $ = cheerio.load(data);
const posts = [];
$('.post-title').each((i, el) => {
posts.push($(el).text());
});
console.log(posts);
})();
I used this for content aggregation sites that pulled trending blog posts and made ad revenue.
4. Express.js — Turning Scripts Into Web Services Once you’ve automated something, why not turn it into an API and sell access?
const express = require('express');
const app = express();
const port = 3000;
app.get('/prices', async (req, res) => {
// Imagine this calls Puppeteer and returns fresh data
res.json({ item: 'Laptop', price: '$799' });
});
app.listen(port, () => console.log(`Server running on http://localhost:${port}`));
I sold API subscriptions to businesses that needed real-time pricing data.
5. Playwright — The New Kid That’s Even Better Than Puppeteer Playwright can automate multiple browsers (Chromium, Firefox, WebKit) and is perfect for projects where clients want cross-browser testing.
6. Building Chrome Extensions That Sell Extensions can be mini SaaS businesses. I built a LinkedIn Auto-Connect tool and charged users $5/month.
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
if (msg.action === 'connect') {
document.querySelectorAll('.connect-button').forEach(btn => btn.click());
sendResponse({ status: 'done' });
}
});
7. Using Stripe.js for Payments If you’re selling scripts or API access, you’ll need payments. Stripe.js makes it easy.
8. Automating Social Media With Node.js Automated posting to Twitter/X, Instagram, and LinkedIn with APIs. Perfect for social media managers who want to scale.
9. Combining APIs for Arbitrage Opportunities Example: Pull hotel prices from one API, compare them to another, and sell the cheaper booking.
10. Packaging & Selling Scripts on Gumroad Once you’ve built a tool, package it, write clear docs, and sell it as a downloadable product.
Read the full article here: https://javascript.plainenglish.io/the-javascript-automations-that-turned-my-side-projects-into-passive-income-machines-be25a740b195