You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Init a `tsconfig.json` for TypeScript options with a few key options in your tsconfig.json (`npx tsc --init --rootDir src --outDir lib --esModuleInterop --resolveJsonModule --lib es6,dom --module commonjs`)
5
+
> 메모: 이러한 많은 단계는 일반적인 Node.js 설정 단계입니다.
10
6
11
-
That's it! Fire up your IDE (e.g. `code .`) and play around. Now you can use all the built in node modules (e.g. `import * as fs from 'fs';`) with all the safety and developer ergonomics of TypeScript!
7
+
1. Node.js 프로젝트 설정에는 `package.json`이 필요합니다. 이 파일을 빠르게 생성하는 방법은 `npm init -y`
8
+
1. 타입스크립트를 추가 (`npm install typescript --save-dev`)
9
+
1.`node.d.ts`를 추가 (`npm install @types/node --save-dev`)
- Usage: `import { style } from 'typestyle';` 타입을 안전하게 사용하는 방법.
76
78
77
79
MORE:
78
80
79
-
* If your package depends on other TypeScript authored packages, put them in`dependencies`/`devDependencies`/`peerDependencies` just like you would with raw JS packages.
80
-
* If your package depends on other JavaScript authored packages and you want to use it with type safety in your project, put their types (e.g.`@types/foo`) in`devDependencies`. JavaScript types should be managed *out of bound* from the main NPM streams. The JavaScript ecosystem breaks types without semantic versioning too commonly, so if your users need types for these they should install the `@types/foo`version that works for them.
81
+
- 패키지가 다른 타입스크립트 패키지에 의존하는 경우 원시 JS 패키지와 마찬가지로`dependencies`/`devDependencies`/`peerDependencies`에 넣으십시요.
82
+
- 패키지가 다른 자바스크립트 패키지에 의존하는 경우에는 프로젝트에 안전하게 타입을 이용하려면 (예:`@types/foo`) 를`devDependencies`에 넣으십시요. 자바스크립트 타입은 NPM 스트림에서 *out of bound*로 관리되어야 합니다. 자바스크립트는 일반적으로 타입을 구분하므로 만약 당신이 `@types/foo`타입이 필요한 경우에는 해당 버전을 설치하십시요.
81
83
82
-
## Bonus points
84
+
## 보너스 포인트
83
85
84
-
Such NPM modules work just fine with browserify (using tsify) or webpack (using ts-loader).
86
+
앞에서 이미 언급한 NPM 모듈은 browserify에서 (tsify) 사용하거나 웹팩에서 (ts-loader)를 사용
0 commit comments