-
4th edition: repo, buy, images, 14.x, APIs, deprecated APIs, changelog
-
Show the version of V8 that is embeded in the NodeJS version that I use:
node -p "process.versions.v8"
-
Starting with Node.js v14.8, top-level await is available (without the use of the
--harmony-top-level-await
command line flag) -
Fix for the file change detection inside of WSL
-
The socket's object events
-
Mirror of the streams implementations in Node.js 18.0.0
-
Configuration that can be passed to the
createWriteStream
method -
Configuration that can be passed to the
createReadStream
method -
File system flags
-
All Node.js streams are instances of the EventEmitter class
-
Readable streams are asynchronous iterables
-
Events emitted on readable streams:
Event's name | Event's description |
---|---|
close |
Emitted when the stream and any of the stream's resources have been closed. No further events will be emitted |
data |
Emitted when new data is read from the stream |
end |
Emitted when all available data has been read |
error |
Emitted when the readable stream experiences an error |
pause |
Emitted when the readable stream is paused |
readable |
Emitted when there is data available to be read |
resume |
Emitted when a readable stream resumes after being in a paused state |
- Events emitted on writable streams:
Event's name | Event's description |
---|---|
close |
Emitted when the stream and any of the stream's resources have been closed. No further events will be emitted |
drain |
Emitted when the writable stream can resume writing data |
error |
Emitted when the writeable stream experiences an error |
finish |
Emitted when the writeable stream has ended and all writes have completed |
pipe |
Emitted when the stream.pipe() method is called on a readable stream |
unpipe |
Emitted when the stream.unpipe() method is called on a readable stream |
- An overview of HTTP
- Postman Echo is a service you can use to test your REST clients and make sample API calls
- HTTP status codes
- To check if a SMTP server is listening on port
4321
use eithertelnet localhost 4321
ornc -v localhost 4321
- Prefer
netcat
instead oftelnet
- List the contents of your
node_modules
directory:npm list
- To see where the
formidable
package was installed typewhich formidable
orwhere formidable
(for Windows) - GitHub's default .gitignore file for Node.js
npm
's semver ranges- Differences between ES modules and CommonJS
- Scaffold an Express.js application:
npx express-generator --view=ejs express-generated-app
async
syntax landend in Node.js 7.6.0- Fastify vs Express: which is better?
- Generate a Fastify application from the command line:
npx fastify-cli generate fastify-generated-app
- Install Docker inside of WSL
- List Docker containers:
docker ps
- Stop a Docker container:
docker stop containerID
- Remove a Docker container:
docker rm --force containerID
- Remove all Docker containers:
docker rm --force $(docker ps --all --quiet)
- Start a MySQL v8 database listening on port
3306
:docker run --publish 3306:3306 --name node-mysql --env MYSQL_ROOT_PASSWORD=PASSWORD --detach mysql:8.0
- Connect to MySQL from Node.js using mysql2 package
- Start a PostgreSQL v14.5 database listening on port
5432
:docker run --publish 5432:5432 --name node-postgres --env POSTGRES_PASSWORD=PASSWORD --detach postgres:14.5
- The
pg
module automatically looks for specifically named variables (PGPORT
,PGPASSWORD
, andPGUSER
) - Builtin PostgreSQL types with stable OID
- Start a MongoDB v4.2.22 database listening on port
27017
:docker run --publish 27017:27017 --name node-mongo --detach mongo:4.2.22
- Start a Redis v7.0.4 database listening on port
6379
:docker run --publish 6379:6379 --name node-redis --detach redis:7.0.4
- Start a password protected Redis database listening on port
6380
:docker run --name node-redis-pwd -d -p 6380:6379 redis redis-server --requirepass PASSWORD
- How to use Redis with Node.js
- Redis cheat sheet with the most needed stuff
- Replace
redis
withioredis
- Implement caching in Node.js Using Redis
- LevelDB workshop
- LevelDB playlist by BlessYahu
- LevelDB playlist by Wei Zhou
tape
assertion methods- Trust proxy configuration for Express.js