npm startThis repo will hold exmaple of design pattern and useful article links
=> Creational Pattern
- Builder Pattern
- Factory Pattern
- Singleton Pattern
Install TypeScript as a dev dependency:
npm install typescript --save-devInitialize a tsconfig.json file in your project directory:
npx tsc --initCreate a src folder for your TypeScript files and add a new .ts file:
mkdir src
cd src
echo > HelloWorld.tsInstall ts-node as a development dependency to run TypeScript files directly:
npm install ts-node --save-devUse ts-node to run TypeScript files without the need to compile manually each time:
npx ts-node src/HelloWorld.tsTo make it easier to run the project, add a start script to your package.json:
"scripts": {
"start": "ts-node src/HelloWorld.ts"
}Now you can run the project with:
npm startThese steps will help you create, compile, and run a simple TypeScript project quickly!