npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

devil-backend-nodejs

v4.0.0

Published

A production-ready Node.js + Express + MongoDB backend boilerplate CLI

Readme

?? devil-backend-nodejs

A production-ready Node.js + Express + MongoDB backend boilerplate CLI with built-in utilities.

npm version npm downloads license


?? Quick Start

\\ash npx devil-backend-nodejs my-app \\

? With Flags (Skip Prompts)

\\ash npx devil-backend-nodejs my-app --cloudinary npx devil-backend-nodejs my-app --email-gmail npx devil-backend-nodejs my-app --email-brevo npx devil-backend-nodejs my-app --razorpay npx devil-backend-nodejs my-app --stripe npx devil-backend-nodejs my-app --docker npx devil-backend-nodejs my-app --cloudinary --email-brevo --razorpay --docker npx devil-backend-nodejs my-app --no-install npx devil-backend-nodejs --help \\


?? CLI Flags

| Flag | Description | |------|-------------| | --cloudinary\ | Add Cloudinary file upload + env variables | | --email-gmail\ | Add Gmail SMTP + env variables | | --email-brevo\ | Add Brevo email + env variables | | --razorpay\ | Add Razorpay payment + env variables | | --stripe\ | Add Stripe payment + env variables | | --docker\ | Add Docker + docker-compose support | | --no-install\ | Skip npm install | | --help, -h\ | Show help menu |


?? Generated Project Structure

\
my-app/ +-- src/ � +-- config/ � � +-- db.js � � +-- constants.js � +-- controllers/ � � +-- authController.js � +-- middleware/ � � +-- authMiddleware.js � � +-- errorHandlerMiddleware.js � � +-- rateLimiter.js � � +-- roleCheckMiddleware.js � +-- models/ � � +-- userModel.js � +-- routes/ � � +-- authRoutes.js � � +-- index.js � +-- utils/ � � +-- ApiError.js � � +-- ApiResponse.js � � +-- generateToken.js � +-- validators/ � +-- authValidator.js +-- app.js +-- server.js +-- .env +-- package.json \\


?? Install Package

\\ash npm install devil-backend-nodejs \\


??? Backend Utilities (CommonJS)

\\js const { asyncHandler, paginate, ApiError, ApiResponse, generateToken, generateOTP, randomString, slugify, capitalize, capitalizeWords, formatDate, timeAgo, pick, exclude, isEmptyObject, calculatePagination, validateEnv, } = require('devil-backend-nodejs'); \\

| Utility | Description | Example | |---------|-------------|---------| | \syncHandler\ | Wrap async controllers | \syncHandler(async (req, res) => {})\ | | \paginate\ | MongoDB pagination | \wait paginate(Model, query, { page, limit })\ | | \ApiError\ | Standard error class |
ew ApiError(404, 'Not found')\ | | \ApiResponse\ | Standard response class |
ew ApiResponse(200, data, 'Success')\ | | \generateToken\ | Generate JWT token | \generateToken(userId)\ | | \generateOTP\ | 6 digit OTP | \generateOTP()\ | |
andomString\ | Random string |
andomString(32)\ | | \slugify\ | Text to URL slug | \slugify('Hello World')\ ? \hello-world\ | | \capitalize\ | Capitalize string | \capitalize('hello')\ ? \Hello\ | | \capitalizeWords\ | Capitalize all words | \capitalizeWords('hello world')\ | | \ ormatDate\ | Format date | \ ormatDate(new Date())\ ? \21 Mar 2026\ | | \ imeAgo\ | Relative time | \ imeAgo('2026-03-20')\ ? \1 day ago\ | | \pick\ | Pick object fields | \pick(req.body, ['name', 'email'])\ | | \exclude\ | Exclude object fields | \exclude(user, ['password'])\ | | \isEmptyObject\ | Check empty object | \isEmptyObject({})\ ? \ rue\ | | \calculatePagination\ | Pagination meta | \calculatePagination(100, 2, 10)\ | | \ alidateEnv\ | Validate env vars | \ alidateEnv(['JWT_SECRET', 'MONGO_URI'])\ |


?? Cloudinary Helper

Set env variables: \\env CLOUDINARY_CLOUD_NAME= CLOUDINARY_API_KEY= CLOUDINARY_API_SECRET= \\

\\js const { uploadToCloudinary, uploadImageToCloudinary, deleteFromCloudinary, getCloudinary, } = require('devil-backend-nodejs');

// File upload (pdf, doc etc) const file = await uploadToCloudinary( req.file.buffer, req.file.originalname, req.file.mimetype, 'documents' );

// Image upload const img = await uploadImageToCloudinary( req.file.buffer, req.file.originalname, req.file.mimetype, 'avatars' );

// Delete await deleteFromCloudinary(publicId);

// Returns // { url, publicId, name } \\


?? Razorpay Helper

Set env variables: \\env RAZORPAY_KEY_ID= RAZORPAY_KEY_SECRET= \\

\\js const { createOrder, verifyPayment, getRazorpay } = require('devil-backend-nodejs');

// Create order const order = await createOrder(499, 'INR');

// Verify payment const isValid = verifyPayment(orderId, paymentId, signature);

// Raw instance const razorpay = getRazorpay(); \\


?? Stripe Helper

Set env variables: \\env STRIPE_SECRET_KEY= STRIPE_WEBHOOK_SECRET= \\

\\js const { createPaymentIntent, constructWebhookEvent, getStripe } = require('devil-backend-nodejs');

// Create payment intent const intent = await createPaymentIntent(499, 'inr');

// Verify webhook const event = constructWebhookEvent(req.body, req.headers['stripe-signature']);

// Raw instance const stripe = getStripe(); \\


?? Gmail Helper

Set env variables: \\env GMAIL_USER= GMAIL_PASS= \\

\\js const { sendGmail, sendOTPGmail, sendWelcomeGmail } = require('devil-backend-nodejs');

// Custom email await sendGmail('[email protected]', 'Subject', 'Hello!');

// OTP email await sendOTPGmail('[email protected]', '123456');

// Welcome email await sendWelcomeGmail('[email protected]', 'Sachin'); \\


?? Brevo Helper

Set env variables: \\env BREVO_API_KEY= BREVO_SENDER_EMAIL= BREVO_SENDER_NAME= \\

\\js const { sendBrevo, sendOTPBrevo, sendWelcomeBrevo } = require('devil-backend-nodejs');

// Custom email await sendBrevo('[email protected]', 'Subject', 'Hello!');

// OTP email await sendOTPBrevo('[email protected]', '123456');

// Welcome email await sendWelcomeBrevo('[email protected]', 'Sachin'); \\


?? Frontend Package

React hooks aur helpers ke liye alag package use karo:

\\ash npm install devil-frontend \\

npm version


commond Get-ChildItem -Recurse | Where-Object { $_.FullName -notmatch "node_modules" } | Select-Object -ExpandProperty FullName

?? Author

Sachin Tiwari


?? License

MIT � Sachin Tiwari