Overview
JavaScript is a versatile programming language that runs in browsers and Node.js environments.
Why It Matters
JavaScript powers interactive web applications and increasingly runs on servers with Node.js.
Essential Commands
node app.jsRun JavaScript file with Node.js
npm installInstall package dependencies
npm run devStart development server
npm run buildBuild production assets
npm testRun test command from package.json
node --watch app.jsRun script and restart on file changes
npx eslint .Run linter on current directory
npx prettier --write .Format code with Prettier
npx tscCompile TypeScript to JavaScript
npx jestRun tests with Jest
npx webpackBundle JavaScript with Webpack
npx create-react-app my-appBootstrap a new React application
npx express-generator my-apiGenerate a new Express.js API project
npx next devStart Next.js development server
npx next buildBuild Next.js application for production
npx next startStart Next.js application in production mode
npx create-next-app my-next-appBootstrap a new Next.js application
npx ts-node script.tsRun TypeScript file directly with ts-node
npx nodemon app.jsRun Node.js app with automatic restarts on file changes
Quick Start
Master master promises and async/await first
Key Concepts
Master promises and async/await
Understand closures and scope
Learn ES6+ syntax and array/object methods
Pro Tips
- Combine multiple commands for powerful workflows
- Use aliases to speed up your command entry
- Create scripts to automate repetitive tasks
Common Pitfalls to Avoid
- • Forgetting to check the documentation for edge cases
- • Running commands without understanding their full impact
- • Not testing changes in a safe environment first