// Using ESM Module syntax:
import * as fs from 'fs/promises';
// Using CommonJS syntax:
const fs = require('fs/promises');
https://github.com/mysticatea/eslint-plugin-node#readme should then probably get an update for node/prefer-promises/fs to also say enforce require("fs/promises"). Note that I have not even tested if it is supported or not, but if it isn't then that should be the main focus of this issue. Otherwise it is just a docs issue.
Since Node.js 15 the recommended way to use the
fs
API is via promises, see https://nodejs.org/api/fs.html#fs_promises_api.https://github.com/mysticatea/eslint-plugin-node#readme should then probably get an update for
node/prefer-promises/fs
to also sayenforce require("fs/promises")
. Note that I have not even tested if it is supported or not, but if it isn't then that should be the main focus of this issue. Otherwise it is just a docs issue.