Prefer the node: protocol prefix for Node.js built-in modules for clarity and consistency.
✅ This rule is included in the node logical presets.
The node: protocol makes it explicit that the module is a Node.js built-in, preventing confusion with npm packages that might have the same name.
The protocol is supported in Node.js 16+ and is the recommended way to import built-ins.
AEimpo53 fAEfr5<3 sp ansty="le--0:#D9F5DD;--1:#1111">13 sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4D1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">51"sp><3;d ivclassNa="meco"><";d>";d>3;d>AEimpo53 patAEfr5<3 sp ansty="le--0:#D9F5DD;--1:#1111">13 sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4Dpa1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">51"sp><3;d ivclassNa="meco"><";d>";d>3;d>AEimpo53 { readFile <} sp ansty="le--0:#C792EA;--1:#8844">AEfr} sp>5<3 sp ansty="le--0:#D9F5DD;--1:#1111">13 sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4D1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">51"sp><3;d ivclassNa="meco"><";d>";d>3;d>AEimpo53 fsPromiseAEfr5<3 sp ansty="le--0:#D9F5DD;--1:#1111">13 sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4Dfs/promis1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">51"sp><3;d ivclassNa="meco"><";d>";d>3;d>AEconsB0crypAE <= sp ansty="le--0:#82AAFF;--1:#3B61">B0requi= sp>5<3(sp ansty="le--0:#D9F5DD;--1:#1111">13(sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4Dcryp1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">531"sp><);d ivclassNa="meco"><);d>);d>);d> 44AEim3F53< fs spans="tyle--0:#C792EA;--1:#88">44AE fs >31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dnod111">1<111" spans="tyle--0:#D6DEEB;--1:#40">3111"><;di vdivclass="Nameexpressive-">44AEim3F53 p44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dnode:111">1<111" spans="tyle--0:#D6DEEB;--1:#40">3111"> | ;di><;di vdivclass="Nameexpressive-">44AEim3F53 { readFil44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dnod111">1<111" spans="tyle--0:#D6DEEB;--1:#40">3111">;di><;di vdivclass="Nameexpressive-">44AEim3F53 fsPromi44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dnode:fs/prom111">1<111" spans="tyle--0:#D6DEEB;--1:#40">3111">;di><;di vdivclass="Nameexpressive-">44AEco61B0cr44A61B0req31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dnode:cr111">1<111" spans="tyle--0:#D6DEEB;--1:#40">3F111"><53) ;divclass="Name">53)>;di>
This rule is not configurable.
If you need to support Node.js versions older than 16, you should not use this rule, as the node: protocol was introduced in Node.js 16.0.0.
If you strongly prefer more succinct imports and aren’t worried about confusing userland modules with built-in Node.js modules, this rule might not be for you.