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.
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.
Generate a UUID in JavaScript using native APIs in both the browser and Node.js.
Learn how to write a JSON object to a file, both using Node.js and in the browser.
Learn how semantic versioning works and how to use it to correctly version your software.
Learn how to type check for different types of streams in Node.js.
Determine if the current JavaScript environment is Node.js or a browser.
Use special Unicode characters to print text in color in the console.
Gets the command-line arguments passed to a Node.js script.
Learn how to create a directory using Node.js, if it doesn't exist.
Returns an array of lines from the specified file.
Checks if the current process's arguments contain the specified flags.
Did you know you can use Chrome Developer Tools to debug your Node.js code? Find out how in this short guide.
Loads a module after removing it from the cache (if exists).