Calculate SHA-256 hash in JavaScript
Calculate a SHA-256 hash in JavaScript using native APIs in both the browser and Node.js.
The Node.js snippet collection contains JavaScript utilities for Node.js 18.x. It includes helper functions related to server-side code and filesystem operations, while general-purpose helpers can be found in the JavaScript snippet collection. All snippets can be used with the ESM syntax.
Calculate a SHA-256 hash in JavaScript using native APIs in both the browser and Node.js.
Create your own static file server with Node.js in just 70 lines of code.
Generate a UUID in JavaScript using native APIs in both the browser and Node.js.
Parse a text file and return an array of lines, synchronously or asynchronously, using Node.js.
The Node.js test module is a new testing tool that's still in its early stages. Learn more about it in this short introduction.
Learn how to write a JSON object to a file, both using Node.js and in the browser.
Learn how to extract command-line arguments passed to a Node.js script.
Learn how to type check for different types of streams in Node.js.
Learn how semantic versioning works and how to use it to correctly version your software.
Determine if the current JavaScript environment is Node.js or a browser.
Ever wanted to convert a tilde path to an absolute path? Here's how you can do it in JavaScript.
Use special Unicode characters to print text in color in the console.
Learn how to create a directory using Node.js, if it doesn't exist.
Ever wanted to reload a module in Node.js? Here's how you can do it.
Did you know you can use Chrome Developer Tools to debug your Node.js code? Find out how in this short guide.