npm init -y
npm install --save-dev jest ts-jest typescript @types/jest
npx tsc --init
npx ts-jest config:init
"type": "module",
"scripts": {
"test:unit": "jest",
"start": "tsx watch src/index.ts"
},
ts.config.json
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ESNext",
"outDir": "dist",
"rootDir": "src",
"esModuleInterop": true,
"strict": true,
"resolveJsonModule": true
},
"include": ["src/**/*"]
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter