A standardized Node.js project template for [Your Organization].
This repository provides a solid foundation for new Node.js projects, enforcing best practices, code quality, and a modern CI/CD workflow using CircleCI.
- Modern Node.js project structure with CommonJS modules
- Pre-commit hooks for linting and formatting
- Unit testing with Jest and JUnit XML output
- Docker support for containerized builds
- Team-specific CircleCI configuration via
.circleci/team-config.yml - CLI application with Commander.js
# Clone the repository (if using as template)
git clone <repository-url>
cd nodejs-starter-template
# Install dependencies
npm install
# Set up pre-commit hooks
npm run prepare# Run the CLI directly
node src/starter-template/main.js
# Or use npm scripts
npm start
npm run hello
npm run build
# Available commands:
node src/starter-template/main.js hello
node src/starter-template/main.js buildTo run all tests using Jest:
npm testFor test coverage:
npm run test:coverageYou should see output indicating that the sample tests in the tests/ directory have run and passed.
# Run ESLint
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Format code with Prettier
npm run format
# Check formatting
npm run format:check
# Run pre-commit checks manually
npm run precommitdocker build -t starter-template:latest .docker run --rm starter-template:latestThis project uses a centralized CircleCI configuration managed by the platform team.
- The main pipeline config
config.ymlis maintained in a separate repo and referenced by all projects. - This repo contains a
.circleci/team-config.ymlfile, which you can use to override or extend jobs/workflows for your team's needs. - For more information, see Platform Team CI/CD Docs.
nodejs-starter-template/
├── src/
│ └── starter-template/
│ ├── index.js # Main library exports
│ ├── cli.js # CLI command implementations
│ └── main.js # CLI entry point
├── tests/
│ ├── test-sample.js # Sample tests
│ └── test-build.js # Build command tests
├── .circleci/
│ └── team-config.yml # Team-specific CI configuration
├── .github/
│ ├── ISSUE_TEMPLATE/ # GitHub issue templates
│ └── PULL_REQUEST_TEMPLATE.md
├── package.json # Dependencies and scripts
├── jest.config.js # Jest configuration
├── .eslintrc.js # ESLint configuration
├── .prettierrc # Prettier configuration
├── .pre-commit-config.yaml # Pre-commit hooks
├── Dockerfile # Docker configuration
└── README.md
See CONTRIBUTING.md for guidelines.
CircleCI Labs is a collection of solutions developed by members of CircleCI's Field Engineering team through our engagement with various customer needs. This repository is part of that collection.
- ✅ Created by engineers @ CircleCI
- ✅ Used by real CircleCI customers
- ❌ not officially supported by CircleCI support
See LICENSE for details.
Replace this text with project-specific details as needed.