Node.js Best Practices - Production Ready Code
Guides developers in writing production-ready Node.js code by following industry best practices for project structure, error handling, and performance.
Install this skill
Security score
The Node.js Best Practices - Production Ready Code skill was audited on Feb 16, 2026 and we found 25 security issues across 3 threat categories. Review the findings below before installing.
Categories Tested
Security Issues
Template literal with variable interpolation in command context
| 93 | console.error(`Missing required environment variables: ${missingEnvVars.join(', ')}`); |
Template literal with variable interpolation in command context
| 148 | return `${timestamp} [${level}]: ${message} ${ |
Template literal with variable interpolation in command context
| 224 | this.status = `${statusCode}`.startsWith('4') ? 'fail' : 'error'; |
Template literal with variable interpolation in command context
| 289 | error = new AppError(`Duplicate field value: ${field}`, 400); |
Template literal with variable interpolation in command context
| 295 | error = new AppError(`Invalid input data: ${errors.join('. ')}`, 400); |
Template literal with variable interpolation in command context
| 527 | logger.info(`Server running on port ${PORT}`); |
Access to .env file
| 45 | ├── .env # Variables de entorno (gitignored) |
Access to .env file
| 46 | ├── .env.example # Template de .env |
Access to .env file
| 63 | env: process.env.NODE_ENV || 'development', |
Access to .env file
| 64 | port: parseInt(process.env.PORT, 10) || 3000, |
Access to .env file
| 67 | uri: process.env.MONGO_URI, |
Access to .env file
| 75 | secret: process.env.JWT_SECRET, |
Access to .env file
| 76 | expiresIn: process.env.JWT_EXPIRE || '7d', |
Access to .env file
| 80 | origin: process.env.CORS_ORIGIN || 'http://localhost:3000', |
Access to .env file
| 84 | level: process.env.LOG_LEVEL || 'info', |
Access to .env file
| 90 | const missingEnvVars = requiredEnvVars.filter(envVar => !process.env[envVar]); |
Access to .env file
| 100 | **.env.example:** |
Access to .env file
| 156 | level: process.env.LOG_LEVEL || 'info', |
Access to .env file
| 177 | if (process.env.NODE_ENV !== 'production') { |
Access to .env file
| 275 | if (process.env.NODE_ENV === 'development') { |
Access to .env file
| 428 | await mongoose.connect(process.env.MONGO_URI, options); |
Access to .env file
| 444 | host: process.env.REDIS_HOST, |
Access to .env file
| 445 | port: process.env.REDIS_PORT, |
External URL reference
| 80 | origin: process.env.CORS_ORIGIN || 'http://localhost:3000', |
External URL reference
| 114 | CORS_ORIGIN=http://localhost:3000 |
Install this skill with one command
/learn @rodrigobermejo/nodejs-best-practices