Node Js Cheat Sheet

Posted : admin On 1/29/2022

Node.js Cheat Sheet. If you’ve read this far, you probably already know, but for those intrigued, Node.JS is an evented I/O framework for the V8 JavaScript engine. It’s ideal for writing scalable network programs such as web servers. Learn how to use JavaScript modules, a way to define reusable logic in your programs.

Node Js Security Cheat Sheet

Server-sideio.on('connection', (socket) = // basic emit socket.emit(/./); // to all clients in the current namespace except the sender socket.broadcast.emit. Media onabort, oncanplay, oncanplaythrough, ondurationchange onended, onerror, onloadeddata, onloadedmetadata, onloadstart, onpause, onplay, onplaying, onprogress.

Few commands I found very useful during development.

npm listshow a tree of every package found in the current folder
npm list -gsame as above ^^, but search also in global packages
npm list -g --depth=0same as above ^^, but do not show every package’s dependencies
npm list [package name]show a tree of every instance found in the current folder of that specific package
npm installinstall all packages in package.json
npm install [package name]install a package
npm install [package name] --saveinstall a package as dependency
npm install [package name] --save-devinstall a package as dev dependency
npm uninstall [package name]uninstall a package
npm install --save username/repo#branch-name-or-commit-or-taginstall package from GitHub repository

Node Js Cheat Sheet Pdf

Node js express cheat sheet


npm inpm install
npm i [package name] -Dnpm install [package name] --save-dev

⚡️ Bonus tip

Node js commands cheat sheet

npm-check is a useful tool to check for outdated, incorrect, and unused dependencies

📚 More info