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
No active XP Potion
Accept a Quest
Login to submit answers
By the end of this step, you'll have a simple working program in Node!
npm install -D typescript @types/node tsx
The -D
flag installs the packages as development dependencies, which means they won't be included in your production build.
{
"compilerOptions": {
"baseUrl": ".",
"target": "esnext",
"module": "esnext",
"rootDir": "./src",
"outDir": "./dist",
"strict": true,
"moduleResolution": "Node",
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["./src/**/*.ts"],
"exclude": ["node_modules"]
}
include
specifies the files to include in the compilationexclude
specifies the files to exclude from the compilationstrict
enables all strict type checking optionsesModuleInterop
allows you to use ES module syntaxmoduleResolution
specifies how modules are resolvedbaseURL
specifies the base directory for module resolution{
...
"type": "module",
"scripts": {
"start": "tsx ./src/index.ts"
},
...
}
function main() {
console.log("Hello, world!");
}
main();
npm run start
If you see "Hello, world!" printed in the console, you're good to go!
Run and submit the CLI tests.
The Boot.dev CLI requires you to be signed in to submit your solution!
Copy/paste one of the following commands into your terminal:
Run
bootdev run 6ea0e583-cdc1-458c-97b6-ff583a330aa0
Submit
bootdev run 6ea0e583-cdc1-458c-97b6-ff583a330aa0 -s
Run the CLI commands to test your solution.
Login to view solution
Using the Bootdev CLI
The Bootdev CLI is the only way to submit your solution for this type of lesson. We need to be able to run commands in your environment to verify your solution.
You can install it here. It's a Go program hosted on GitHub, so you'll need Go installed as well. Instructions are on the GitHub page.