Skip to main content

Posts

Showing posts with the label Developer Tools

How to Build and Publish a Custom Node.js Utility Package

Build a Custom Node.js Utility Package – Step-by-Step Guide 🚀 View GitHub Repo: node-custom-package-guide 💡 Want to reuse common string operations like capitalize() or slugify() across projects? Learn how to create and publish your own Node.js utility package! 📁 Project Structure custom-package/ ├── index.js ├── package.json ├── README.md └── utils/ ├── capitalize.js ├── camelCase.js ├── slugify.js └── greeting.js ✅ Initialize the Package npm init -y This creates a package.json with default values. 🧩 Write Utility Functions utils/capitalize.js function capitalize(str) { return str.charAt(0).toUpperCase() + str.slice(1); } module.exports = capitalize; utils/camelCase.js function camelCase(str) { return str .replace(/\s(.)/g, (match, group1) => group1.toUpperCase()) .replace(/\s/g, '') .replace(/^(.)/, (match, group1) => group1.toLowerCase()); } module.exports ...

How to Use Ngrok for Your Local Project

How to Use Ngrok for Your Local Project When you're developing a project locally, sometimes you need to expose it to the outside world — for testing webhooks (like Stripe, RevenueCat, Razorpay), sharing work with clients or teammates, or testing mobile apps. That’s where Ngrok becomes incredibly useful. 🔍 What is Ngrok? Ngrok is a tool that creates a secure tunnel to your localhost. It provides a public URL that maps to your local web server. It's perfect for testing APIs, webhooks, or sharing local work without deploying it. 🛠️ How to Install Ngrok Download it from the official website: ngrok.com/download # For Linux/macOS: unzip ngrok-stable-linux-amd64.zip mv ngrok /usr/local/bin # For Windows: # Unzip and run ngrok.exe from CMD or add it to your PATH 🚀 How to Use Ngrok with Your Project 1. Start Your Local Server For example, if you're running Laravel or Node.js on port 8000 : php artisan serve # O...