This repo contains several programs including:
- Text server
- Static file server serving static HTML files
- Dictionary app serving and writing to a JSON file
- Countdown installed globally
- Socket chat app in the browser using web sockets
- Socket.io terminal chat app
- Run a file with
npx babel-node <file-path>
npx babel-node ./programs/request.js
- Or with script
npm run tx -- <file-path>
npm run tx -- <file-path>
// For example:
npm run tx -- ./server/plain-text.js
- add at top file:
#!/usr/bin/env node
- in package.json, add bin:
"bin": {
"countdown": "countdown.js"
},
-
run
npm link
-
run
countdown
-
remove with
npm unlink
- set with
$ export NODE_ENV=development
- check with
$ echo $NODE_ENV
in terminal - use with
process.env.NODE_ENV