📚 Cheatsheet

Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.

Snippets 7

Retour
Hooks de script (pre/post)
Avancé
"scripts": {
  "preinstall": "echo 'Avant l installation'",
  "install": "node install-script.js",
  "postinstall": "echo 'Après l installation'"
}
NPM - Définir un script personnalisé
Facile
"scripts": {
  "start": "node index.js",
  "test": "jest"
}
NPM - Lancer un exécutable de paquet (npx)
Facile
npx create-react-app mon-app
NPM - Lancer un script
Facile
npm run test
Passer des arguments à un script
Intermédiaire
npm run test -- --watch
Yarn - Lancer un exécutable de paquet (dlx)
Facile
yarn dlx create-react-app mon-app
Yarn - Lancer un script
Facile
yarn test