> For the complete documentation index, see [llms.txt](https://atit.gitbook.io/javascript-basic/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atit.gitbook.io/javascript-basic/typescript/init-typescript.md).

# init typescript

## Getting Start

### install typescript

```
//  if yet
$ npm i -g typescript


// create tsconfig.json
$ tsc --init
```

tsconfig.json Clean

```
// Delete Comment Out Line 
$ ^.*    // .*$(\r\n|\r|\n)?
 
$ ^    /*/.*$(\r\n|\r|\n)?
```

tsconfig.json Basic

```javascript
{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  }
}

```

### test

```javascript
// create test.ts
export function test(){
  return "test"
}

// command run
$ tsc

// auto create JavaScript => test.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.test = void 0;
function test() {
    return "test";
}
exports.test = test;


```
