Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To run the code

npm start

Design-Patterns

This repo will hold exmaple of design pattern and useful article links

=> Creational Pattern

  1. Builder Pattern
  2. Factory Pattern
  3. Singleton Pattern

Minimal Steps to Create and Run a TypeScript Project

Step 1: Install TypeScript

Install TypeScript as a dev dependency:

npm install typescript --save-dev

Step 2: Create TypeScript Configuration

Initialize a tsconfig.json file in your project directory:

npx tsc --init

Step 3: Write TypeScript Code

Create a src folder for your TypeScript files and add a new .ts file:

mkdir src
cd src
echo > HelloWorld.ts

Step 4: Run TypeScript Code Directly (Using ts-node)

Install ts-node as a development dependency to run TypeScript files directly:

npm install ts-node --save-dev

Use ts-node to run TypeScript files without the need to compile manually each time:

npx ts-node src/HelloWorld.ts

Step 5: Add a Start Script to package.json

To 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 start

These steps will help you create, compile, and run a simple TypeScript project quickly!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages