

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Welcome
incomplete
2: TypeScript Setup
incomplete
3: Normalize URLs
incomplete
4: Extract Page Content
incomplete
5: Extract Links and Images
incomplete
6: Structure Page Data
incomplete
This lesson's interactive features are locked, please to keep using them
npm stands for "Node Package Manager". By installing Node.js, you've gained some new commands:
node - The JavaScript runtime. This will let you run your application files.npm - The package manager. This manages dependencies, metadata, and allows you to specify "scripts" to run.npx - The package runner. Run a command from a local or remote npm package.Most TS devs don't run the node commands directly, they use it within an npm script.
npm init
This command will prompt you with a series of questions. For this project, you can either press Enter for the recommended defaults or follow the prompts.
npm install -D typescript @types/node tsx
console.log("Hello, World!");
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"moduleResolution": "Node"
},
"include": ["./src/**/*.ts"],
"exclude": ["node_modules"]
}
...
"type": "module",
"scripts": {
"start": "tsx ./src/index.ts"
},
...
This enables your project to use ES modules and adds a "start" script to this project that runs index.ts using the tsx typescript executable.
npm start
And you should see your "hello world" message logged to the console!
A .gitignore file is used to tell Git which files or folders to ignore when committing changes to a repository. This is useful for ignoring files that are specific to your local development environment or files that should not be tracked in the repository, such as compiled files or sensitive information.
Submit the CLI tests from your project's root. There's no penalty on failure for this lesson.