Skip to content

Commit 69b6031

Browse files
maxbeattyrauchg
authored andcommitted
add typescript example (#194)
1 parent dba447a commit 69b6031

File tree

5 files changed

+91
-0
lines changed

5 files changed

+91
-0
lines changed

examples/typescript/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# TypeScript
2+
3+
## How to use
4+
5+
Within this directory, run `yarn` to install dependencies.
6+
7+
To execute the Node.js program with `ncc`, run `yarn dev`.
8+
9+
To build the program with `ncc`, run `yarn build`.

examples/typescript/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import chalk from "chalk";
2+
3+
function logSuccess(msg: string) {
4+
console.log(chalk.green(msg));
5+
}
6+
7+
logSuccess("Hello World!");

examples/typescript/package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "typescript",
3+
"private": true,
4+
"version": "0.0.0",
5+
"license": "MIT",
6+
"scripts": {
7+
"dev": "ncc run index.ts",
8+
"build": "ncc build index.ts -o dist"
9+
},
10+
"dependencies": {
11+
"chalk": "^2.4.1"
12+
},
13+
"devDependencies": {
14+
"@zeit/ncc": "latest"
15+
}
16+
}

examples/typescript/tsconfig.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2015",
4+
"moduleResolution": "node"
5+
}
6+
}

examples/typescript/yarn.lock

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
"@zeit/ncc@latest":
6+
version "0.8.1"
7+
resolved "https://registry.yarnpkg.com/@zeit/ncc/-/ncc-0.8.1.tgz#f24982591fe0e2a0f2c53e59e533837eddb8b891"
8+
integrity sha512-AFgYOmh8gVRd8Bzkvygvbhdq6DayCc+O++bcGr+TFQcsHLWa6Lx9L55VVGU8sVEJibX/6BkDgcrJFZ3vYbh/ww==
9+
10+
ansi-styles@^3.2.1:
11+
version "3.2.1"
12+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
13+
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
14+
dependencies:
15+
color-convert "^1.9.0"
16+
17+
chalk@^2.4.1:
18+
version "2.4.1"
19+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
20+
integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==
21+
dependencies:
22+
ansi-styles "^3.2.1"
23+
escape-string-regexp "^1.0.5"
24+
supports-color "^5.3.0"
25+
26+
color-convert@^1.9.0:
27+
version "1.9.3"
28+
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
29+
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
30+
dependencies:
31+
color-name "1.1.3"
32+
33+
color-name@1.1.3:
34+
version "1.1.3"
35+
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
36+
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
37+
38+
escape-string-regexp@^1.0.5:
39+
version "1.0.5"
40+
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
41+
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
42+
43+
has-flag@^3.0.0:
44+
version "3.0.0"
45+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
46+
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
47+
48+
supports-color@^5.3.0:
49+
version "5.5.0"
50+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
51+
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
52+
dependencies:
53+
has-flag "^3.0.0"

0 commit comments

Comments
 (0)