How Do You Create, List and Delete Folders in Node.js?
Create, list and delete folders in Node.js using mkdir, readdir and rm with recursive options, Dirent types and a safe directory walker.
48 posts about Node.js: questions with answers, tutorials and articles, newest first.
Create, list and delete folders in Node.js using mkdir, readdir and rm with recursive options, Dirent types and a safe directory walker.
Use fs promises in Node.js with async and await for reading, writing and copying files, run work in parallel and close file handles correctly.
Understand how Sync, callback and promise fs methods differ in Node.js, why blocking hurts servers, and when sync calls are acceptable.
Write, overwrite and append to files in Node.js with writeFile and appendFile, choose the right flags and save JSON or large data safely.
Read text, JSON and large files in Node.js using readFile, readFileSync, fs promises and streams, and handle errors like ENOENT correctly.
Use the Node.js path module to build, split and normalise file paths across operating systems, with join, resolve, parse and a safe traversal check.
Set up an npm workspaces monorepo with one install and lockfile, link local packages, run scripts across them and know when to add a task runner.
Prepare package.json, preview the tarball with npm pack, publish with npm publish, manage versions and tags, and release safely from CI with provenance.
Compare npm, Yarn and pnpm on commands, node_modules layout, lockfiles, speed and monorepo support, and learn which one fits your Node.js project.
Run npm audit, apply compatible fixes with npm audit fix, and handle findings that need major upgrades or overrides without breaking your application.
Read the npm outdated report, apply safe updates with npm update, and upgrade breaking major versions one package at a time with tests and an easy rollback.
npx runs package commands without a permanent install. Learn how it finds tools, when to choose it over global installs and how to stay safe.
npm scripts turn long commands into short names such as npm run dev. Learn how to define, chain, hook and configure them in package.json.
package-lock.json pins every installed package to an exact version. Learn what it contains, why you commit it and how npm ci relies on it.
Semantic versioning explained for npm: what MAJOR.MINOR.PATCH mean, how caret and tilde ranges differ and how npm picks versions.
Learn what dependencies and devDependencies mean in package.json, how npm treats each at install time and how to pick the right group.
Add packages with npm install and remove them with npm uninstall. See the flags, the files npm changes and how to fix common install problems.
package.json is the manifest of a Node.js project. Learn how to create it and what each common field does, with examples.
Top-level await lets ES modules wait for async work without a wrapper function. Learn how to enable it and where it fits.
Circular requires give a module partial exports. Learn how CommonJS and ES modules differ, how to detect cycles, and how to fix them.