logo

Node.js

Install

Node package manger puts various things on your computer. On OpenBSD it stores everything under /usr/local and that directory is owned by root. If you install modules globally (for example, prettier or eslint) I suggest you set npm prefix to ~/.node and add update PATH accordingly.

# pkg_add node
quirks-3.16 signed on 2018-10-12T15:26:25Z
node-8.12.0:flock-20110525p1: ok
node-8.12.0:gmake-4.2.1: ok
node-8.12.0: ok
...
#
$ npm set prefix "$HOME/.node"
$ npm install --global prettier
$ echo '
export PATH="$HOME/.node/bin:$PATH"
' >> "$HOME/.profile"
$

Create an HTTP server with Express

unit testing
diagnostics (basics, debugging, performance)
http(s)/tcp
events
child processes (basics, no ipc/fork)
buffer and streams
error handling
file system
control flow (async tasks, callbacks)
cli (-e, -r, etc)
package.json
javascript prerequisites (closures, prototypes, var/let/const)
security
module system (scope)
process/operating system (no ipc)