# 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;


```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://atit.gitbook.io/javascript-basic/typescript/init-typescript.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
