This repo demos the basic usage of TypeScript as building a simple application.
This mini-project accepts a GitHub username as a command-line argument, internally makes call to GitHub API, and displays the user information as well as that user's repos.
The source code is under src/
, and the output JavaScript files will be compiled to out/
So we define a new script
in package.json
for quick run:
{
// ...
"scripts": {
"start": "rm -rf out/* && tsc && node out/index",
// ...
}
// ...
}
To run the project, simply use the command-line, and pass in the GitHub username:
$ npm start <your GitHub username>