Skip to content

usama-akmal/BWT-TS

Repository files navigation

BWT-TS

Basic Commands

Setup Node project

npm init

Install Typescript

npm install typescript --save-dev

Compile file (OPTIONAL)

npx tsc <file-name> ...

Setup Typescript project using tsconfig.json

npx tsc --init

Content tsconfig.json

{
  "compilerOptions": {
    "target": "es2016",
    "module": "commonjs",
    "rootDir": "./src", 
    "outDir": "./dist",
    "esModuleInterop": true,   
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true,
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ]
}

Create a src folder

mkdir src

Create a typescript file in src directory

touch src/main.ts

Compile with watch

npx tsc --watch

Run using node

node dist/<file-name>.js

Run using html

<!-- Inject the generated javascript to html page -->
<script src="dist/<file-name>.js"></script>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published