# Node.js
[Website](https://nodejs.org/en)
[Official Guide](https://nodejs.org/en/docs/guides/getting-started-guide)
(https://nodejs.org/api/http.html)
[dev tools](https://developer.amazon.com/en-US/alexa/alexa-skills-kit/get-deeper/dev-tools-skill-management-api)
[Official Library](https://nodejs.org/api/)
- [HTTP](https://nodejs.org/api/http.html)
"npm" = "node package manager"
"A local development environment"
- used for [[Build Obsidian Plugin]]
- Downloaded onto laptop (version 18.18.0 LTS)
![[Pasted image 20231004150344.png]]
During Install:
- Selected: "Optionally install the tools necessary to compile native modules. Automatically install the necessary tools. Note that this will also install Chocolatey."
- Canceled above download - requested to close all programs and let run for a while - can go to a link (that I no longer have, but linked to GitHub) to download them manually later
### What is it
open-source and cross-platform JavaScript runtime environment
new ECMAScript standards can be used without problems
>they have a registry of all the packages and modules which is accessed by a command line interface. Think of it as the central library of code snippets that everyone can "borrow" at once. npm makes it so that you can search for specific features you need to add, (via https://www.tatianamac.com/posts/beginner-eleventy-tutorial-partii)
### Examples
[Official Examples on GitHub](https://github.com/nodejs/examples)
**"Hello World"**
To run: save file as `server.js` and in terminal, run `node server.js`
```
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
```
## Resources
[Guide - W3 Schools](https://www.w3schools.com/nodejs/default.asp)