A template for creating NPM packages with TypeScript, Jest, and ESLint.
This template is used by Simply Express Generator to generate barebones TypeScript libraries.
- TypeScript for static typing
- Jest for testing
- ESLint for linting
- Convenient npm scripts for building, testing, and linting
The project follows this basic structure:
├── src/ # Source files
│ ├── helloWorld.ts # Sample function
│ └── index.ts # Entry point exporting all public APIs
├── test/ # Test files
│ ├── helloWorld.test.ts # Test for the sample function
│ └── tsconfig.json # TypeScript configuration for Jest
├── package.json # Project metadata and dependencies
├── tsconfig.json # TypeScript compiler configuration
└── README.md
Once you generate a project with this template, you can use these commands:
npm run build
: Compile TypeScript files into JavaScriptnpm run test
: Run tests with Jestnpm run test:cov
: Run tests and generate a coverage reportnpm run lint
: Lint the project with ESLintnpm run lint:fix
: Lint the project and automatically fix problems
Contributions, issues, and feature requests are welcome! Feel free to check issues page.