node.jsnode-modulesrequire

What are the `node:fs`, `node:path` etc. modules?


Recently, while using a linter, I discovered that the names of some built-in packages where prepended with node:. I searched a lot but I didn't get any useful info. What is this node:module syntax?


Solution

  • Core modules can also be identified using the node: prefix, in which case it bypasses the require cache. For instance, require('node:http') will always return the built in HTTP module, even if there is require.cache entry by that name.

    https://nodejs.org/api/modules.html