Init NestJS

Se placer dans le dossier qui sera la racine du projet.

Initialisation du repo

git init
git commit --allow-empty -m 'First!'

(source : https://docs.nestjs.com/first-steps)

Initialisation du projet

npm i -g @nestjs/cli
nest new \
  --directory . \
  --package-manager npm \
  --strict

git add .
git commit -m "build: nest new"

npm pkg set scripts.start="npm run dev"
npm pkg set scripts.dev="nest start --watch"

git add .
git commit -m "build: start script"

Prettier

curl -fsSL https://devdocs.nex.ws/files/prettier/.prettierrc -o ./.prettierrc

git add .
git commit -m "build: prettier config"

npx prettier -w .

git add .
git commit -m "build: run prettier"

Njb Nestia

[ -f .npmrc ] && printf '\n' >> .npmrc
printf '%s\n%s\n' \
  '@njb:registry=https://gitlab.com/api/v4/packages/npm/' \
  '//gitlab.com/api/v4/packages/npm/:_authToken=${NJB_NPM_TOKEN}' >> .npmrc
npm i @njb/nestia -D
npx njb-nestia setup
git add .
git commit -m "build: install @njb/nestia"

(source : https://gitlab.com/njb/njb-nestia)

Dernière modification 17.01.2026: Edit nest.md (ad3a12e)