Node.js
Misc
- Make a Promise out of a Callback function in JavaScript
- Use node for shell scripting: google/zx
- Set up a new TypeScript project
- How to Build an AWS Lambda Function in Typescript (src: scotch.io)
- How to fix "__dirname is not defined in ES module scope"
- [Using
zx
with TypeScript, ESM and top-levelawait
] - Compile a Node.js project into a single file: npmjs.com/@vercel/ncc
- Test server for OpenAPI specs: @openapi-generator-plus/typescript-express-example-server-generator.
Installing node.js
Source: Set up your Node.js development environment with WSL 2
# Get Node version manager. Check for newer release at https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install node # Install the newest node
nvm install --lts # Install the current LTS version
# Set some defaults form npm init. See current settings with "npm config list | grep init"
npm set init-author-name "Mads Hvelplund"
npm set init-author-email "mads@swissarmyronin.dx"
npm set init-author-url "https://your-url.com"
npm set init-license "MIT"
npm set init-version "1.0.0"
Make sure that neither path for node and npm hit the ones installed locally by NVM!
Setup new project
Initialize a project with: