Personal template for Node.js projects.
- Create a new repository from this template
- Run
git clone {NEW_REPO_URL}
- Configure the template for your new project
- Update
README.md
- Update
package.json
- Delete
.env.example
or rename to.env
- Update
- Run
npm install
to install dependencies and Git hooks - Run
npm start
to start development server
NOTE: Run git config core.filemode false
if your development environment causes problematic file permissions (e.g. WSL with mounted drives).
Purpose | Package | Config file |
---|---|---|
Linter | ESLint | .eslintrc.json |
Formatter | Prettier | .prettierrc.json |
Git hooks | Husky | .huskyrc.json |
Lint runner | lint-staged | .lintstagedrc.json |
VS Code config | jsconfig.json |
- Secrets
- Create
.env
file in root directory (example:.env.example
) or pass through npm scripts - Access in code with
process.env.{VARIABLE}
- Create
Command | Description |
---|---|
npm run clean:node_modules |
Clean node_modules directory |
npm run format:check |
Check for formatting issues |
npm run format:fix |
Fix formatting issues |
npm run lint:check |
Check for linting issues |
npm run lint:fix |
Fix linting issues |
npm start |
Start development server |
.gitignore
.eslintignore
.prettierignore
- TypeScript
- Jest
- Should work on Unix-like operating systems and WSL
- PM2 — production process manager
MIT © Dusk