// BASH
mkdir src
mkdir build
touch src/index.ts
touch .gitignore
touch README.md
tsc -y
npm init -y
npm install nodemon concurrently @types/express --save-dev
// package.json
...
"scripts": {
"start:build": "tsc -w",
"start:run": "nodemon ./build/index.js",
"start": "concurrently npm:start:*"
},
...
// tsconfig.json
...
"outDir": "./build",
"rootDir": "./src",
...
// .gitignore
node_modules
*.env
// README.md
### Start
```bash
npm run start
```
// src/index.ts
import express from 'express'
const port = 3000
const app = express()
console.log("Hello, World!!!")
logSomething("This is a string that I'm logging")
app.listen(port, () => {
console.log(`Listening on port ${port}`)
})
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