Registry / devops / node-mysql-boilerplate

node-mysql-boilerplate

JSON →
library1.0.7jsnpmunverified

A boilerplate for Node.js applications with MySQL, providing an MVC-like structure, basic schema validation, JWT authentication, and common error handling. Version 1.0.7 is the latest, with no regular release cadence. It includes pre-configured packages for email (nodemailer), load testing (artillery), process management (pm2), and password hashing (bcrypt). It is designed for quick starting CRUD APIs with MySQL, but lacks TypeScript support, testing frameworks, and active maintenance.

npm install node-mysql-boilerplate
INSTALL
IMPORT
SIG · NODE-MYSQL-BOILERP
N
node-mysql-boilerplate
devopsjavascriptv1.0.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const app = require('express')()
import * as express from 'express'
CommonJS only; no ESM support.
mysql
const mysql = require('mysql')
import mysql from 'mysql'
mysql package is CommonJS only.
jwt
const jwt = require('jsonwebtoken')
import jwt from 'jsonwebtoken'
jsonwebtoken is CommonJS only.

Clones the boilerplate, installs dependencies, configures MySQL, and starts the server with default endpoints.

// Clone the repository git clone https://github.com/yug95/node-mysql.git cd node-mysql // Install dependencies npm install // Set environment variables (optional, defaults exist) // edit config/config.js with your MySQL credentials // Start the application node app.js // Test the API endpoints (example with curl) curl http://localhost:3000/api/users
Debug
Known issues
deprecatedThe mysql package is unmaintained and deprecated; use mysql2 instead.
fix
Replace mysql with mysql2 in package.json and update connection code.
affects: >=1.0
gotchaBoilerplate uses CommonJS only; ESM imports will fail.
fix
Use require() syntax for all imports.
affects: >=1.0
gotchaNo TypeScript definitions are provided; using with TypeScript requires custom type declarations.
fix
Install @types/node, @types/express, and manually declare modules.
affects: >=1.0
gotchaDefault configuration expects MySQL on localhost; environment setup required for production.
fix
Update config/config.js with production database credentials.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module 'mysql'
Missing mysql dependency
fix
Run npm install mysql
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost'
Incorrect MySQL credentials
fix
Update config/config.js with correct username and password.
TypeError: jwt.verify is not a function
Incorrect require or typo
fix
Ensure require('jsonwebtoken') is used correctly.
Upgrade
Version history
1.0.7latest on npm
Audit
Dependencies
mysqlrequiredDatabase driver for MySQL
expressrequiredWeb framework for Node.js
ajvrequiredJSON schema validation
jsonwebtokenrequiredJWT authentication
nodemailerrequiredEmail sending
bcryptrequiredPassword hashing
Agent activity
2 hits · last 30 days
node
2
Resources
node-mysql-boilerplate — npm install node-mysql-boilerplate · libregistry