Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxgfr/typescript-swc-starter
A minimalist typescript swc starter that generate cjs and esm package
https://github.com/maxgfr/typescript-swc-starter
boilerplate cjs dotenv eslint esm jest node nodejs nodemon prettier rust-compiler starter starter-kit swc typescript unbuild
Last synced: about 1 month ago
JSON representation
A minimalist typescript swc starter that generate cjs and esm package
- Host: GitHub
- URL: https://github.com/maxgfr/typescript-swc-starter
- Owner: maxgfr
- License: mit
- Created: 2022-03-06T15:12:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T22:16:22.000Z (about 2 months ago)
- Last Synced: 2024-10-30T00:42:34.510Z (about 2 months ago)
- Topics: boilerplate, cjs, dotenv, eslint, esm, jest, node, nodejs, nodemon, prettier, rust-compiler, starter, starter-kit, swc, typescript, unbuild
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/typescript-swc-starter
- Size: 3.22 MB
- Stars: 30
- Watchers: 1
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# typescript-swc-starter
A simple node boilerplate made in typescript using swc which generates `cjs` and `esm` modules.
## Clone repository and install dependencies
```sh
git clone https://github.com/maxgfr/typescript-swc-starter # For cloning the repository
cd typescript-swc-starter # To navigate to the repository root
yarn # Install dependencies
```:warning: You have to use at least `node@20` to run this project.
## Commands
```sh
yarn dev # For running the code in development thanks to swc and nodemonyarn test # For running unit test
yarn test:watch # For watching unit testyarn lint # For linting the code
yarn lint:fix # For linting the code and fix issuesyarn bundle # For generating bundling in cjs and esm
yarn start:cjs # For running the code builded in cjs
yarn start:esm # For running the code builded in esm
```## Publish to npm
Set `NPM_TOKEN` in your Github actions secret, and that's it :)
![Alt Text](https://raw.githubusercontent.com/maxgfr/typescript-swc-starter/main/.github/assets/token.png)
To test this package, just do that :
```ts
import { sayHello } from 'typescript-swc-starter';
sayHello();
```