Änderungen

Zur Navigation springen Zur Suche springen
580 Bytes hinzugefügt ,  20:29, 13. Apr. 2023
Zeile 43: Zeile 43:  
* https://dev.to/raphaelmansuy/boost-your-productivity-by-creating-your-own-cli-command-with-typescript-part-1-5g37
 
* https://dev.to/raphaelmansuy/boost-your-productivity-by-creating-your-own-cli-command-with-typescript-part-1-5g37
 
* https://medium.com/geekculture/building-a-node-js-cli-with-typescript-packaged-and-distributed-via-homebrew-15ba2fadcb81.
 
* https://medium.com/geekculture/building-a-node-js-cli-with-typescript-packaged-and-distributed-via-homebrew-15ba2fadcb81.
 +
 +
 +
==== Beispiel für Library in Typescript ====
 +
Siehe
 +
* https://itnext.io/how-to-create-your-own-typescript-cli-with-node-js-1faf7095ef89
 +
* [[TypeScript#TypeScript_und_Jest]]
 +
 +
Im Terminal:
 +
  npm init
 +
  npm install --save-dev ts-jest typescript jest @types/jest ts-node
 +
  npx tsc --init
 +
 +
Anpassen von package.json
 +
  "scripts": {
 +
    "test": "jest",
 +
    "test:watch": "jest --watch",
 +
    "build": "tsc"
 +
  },
 +
 
 +
Anpassen von tsconfig.json
 +
  "rootDir": "./src",                               
 +
  "types": ["jest"],
 +
  "outDir": "./dist",
 +
   
 +
 +
Im Terminal
 +
  npx ts-jest config:init
    
=== TypeScript literals ohne einen bestimmten String ===
 
=== TypeScript literals ohne einen bestimmten String ===

Navigationsmenü