Kickstart your next Node.js package with this pre-configured TypeScript template. Get up and running in minutes!
- TypeScript: Type-safe code with @tsconfig/recommended settings.
- Jest: Write comprehensive tests with ease.
- Biome: Maintain a consistent code style with automated linting and formatting.
- rimraf: Easily clean your build directory.
- release-it: Automatically generate release notes, tag ... and publish your release.
- Built and signed via GitHub Actions: Create a GitHub release and your package will be published automatically.
You can quickly create a new repository from this template by clicking the Use this template button at the top of the repository page on GitHub.
Alternatively, you can use npx degit
to scaffold a new project from this template:
-
Scaffold the project:
npx degit lehuygiang28/package-starter my-package cd my-package
-
Install dependencies:
npm install
You can also clone the repository manually:
-
Clone the repository:
git clone https://github.com/lehuygiang28/package-starter.git my-package cd my-package
-
Install dependencies:
npm install
build
: Builds the projectprepare
: Prepares the project for publishingtest
: Runs the teststest:cov
: Runs the tests with coveragelint
: Lints the codelint:fix
: Lints the code and fixes any errorsformat
: Formats the codeformat:fix
: Formats the code and fixes any errorsrelease
: Releases the projectrelease:pre
: Pre-releases the project
- Install the Biome extension for a seamless development experience.
============================
Root directory of the package
package-starter
βββ .github # Github configurations
βββ .vscode # Visual Studio Code configurations
βββ example # Example usage of the package
βββ lib # Compiled JavaScript code
βββ node_modules # Node.js modules installed by npm or yarn
βββ src # Source code of the package
βββ test # Test files
βββ .editorconfig # Configuration file for code editor settings
βββ .gitignore # Files and folders to be ignored by Git
βββ .npmignore # Files and folders to be ignored by npm
βββ .release-it.json # Configuration file for release-it, a tool for automating releases
βββ biome.json # Configuration file for Biome, a code formatter and linter
βββ jest.config.ts # Configuration file for Jest, a testing framework
βββ LICENSE # License file for the project
βββ package-lock.json # Lockfile generated by npm, specifying the exact versions of installed packages
βββ package.json # Manifest file for the package, containing metadata and dependencies
βββ README.md # Readme file for the project
βββ tsconfig.json # Configuration file for TypeScript
============================
Subdirectories of the package
.
βββ ...
βββ .github # Github configurations
β βββ workflows # Github workflows
β β βββ build-and-test-pr.yml # Workflow for building and testing pull requests
β β βββ publish.yml # Workflow for publishing the package
β βββ CODE_OF_CONDUCT.md # Code of conduct for the project
β βββ FUNDING.md # Information about funding the project
βββ ...
.
βββ ...
βββ .vscode # Visual Studio Code configurations
β βββ extensions.json # Recommended extensions for the project
β βββ settings.json # Project-specific settings for VS Code
βββ ...
.
βββ ...
βββ example # Example usage of the package
β βββ index.ts # Example script
βββ ...
Files compiled from TypeScript
.
βββ ...
βββ lib # Compiled JavaScript code
β βββ hello-world.d.ts # TypeScript definition file for hello-world.js
β βββ hello-world.js # Compiled JavaScript code for hello-world.ts
β βββ index.d.ts # TypeScript definition file for index.js
β βββ index.js # Compiled JavaScript code for index.ts
βββ ...
All installed Node.js modules by run
npm install
oryarn install
.
βββ ...
βββ node_modules # Node.js modules installed by npm or yarn
β βββ ... # All installed Node.js modules
βββ ...
Write your TypeScript code here
.
βββ ...
βββ src # Source code of the package
β βββ hello-world.ts # TypeScript code for a hello world function
β βββ index.ts # Main entry point of the package
βββ ...
.
βββ ...
βββ test # Test files
β βββ hello-world.test.ts # Unit tests for hello-world.ts
βββ ...
Configuration files for the package
.
βββ ...
βββ .editorconfig # Configuration file for code editor settings
βββ .gitignore # Files and folders to be ignored by Git
βββ .npmignore # Files and folders to be ignored by npm
βββ .release-it.json # Configuration file for release-it, a tool for automating releases
βββ biome.json # Configuration file for Biome, a code formatter and linter
βββ jest.config.ts # Configuration file for Jest, a testing framework
βββ LICENSE # License file for the project
βββ package-lock.json # Lockfile generated by npm, specifying the exact versions of installed packages
βββ package.json # Manifest file for the package, containing metadata and dependencies
βββ README.md # Readme file for the project
βββ tsconfig.json # Configuration file for TypeScript
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
MIT Β© LΓͺ Huy Giang