
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
@putout/plugin-nodejs
Advanced tools
Node.js is an open-source, cross-platform, JavaScript runtime environment.
(c) nodejs.org
🐊Putout plugin adds ability to transform to new Node.js API and apply best practices.
npm i putout @putout/plugin-nodejs -D
{
"rules": {
"nodejs/convert-fs-promises": "on",
"nodejs/convert-promisify-to-fs-promises": "on",
"nodejs/convert-dirname-to-url": "on",
"nodejs/convert-url-to-dirname": "on",
"nodejs/convert-top-level-return": "on",
"nodejs/declare-after-require": "on",
"nodejs/remove-process-exit": "on"
}
}
Convert fs.promises into form that will be simpler to use and convert to and from ESM.
const {readFile} = require('fs').promises;
const {readFile} = require('fs/promises');
const fs = require('fs');
const readFile = promisify(fs.readFile);
const {readFile} = require('fs/promises');
Only for ESM.
import {readFile} from 'fs/promises';
const file1 = join(__dirname, '../../package.json');
const file2 = path.join(__dirname, '../../package.json');
import {readFile} from 'fs/promises';
const file1 = new URL('../../package.json', import.meta.url);
const file2 = new URL('../../package.json', import.meta.url);
Only for CommonJS.
const {readFile} = require('fs/promises');
const file = new URL('../../package.json', import.meta.url);
const {readFile} = require('fs/promises');
const file = join(__dirname, '../../package.json');
In most cases process.exit() is called from bin directory, if not - disable this rule using match.
-process.exit();
return;
process.exit();
Add declarations to built-in node.js modules:
await readFile('hello.txt', 'utf8');
import {readFile} from 'fs/promises';
await readFile('hello.txt', 'utf8');
Node.js follows the CommonJS module system, and the builtin
requirefunction is the easiest way to include modules that exist in separate files. The basic functionality ofrequireis that it reads a JavaScript file, executes the file, and then proceeds to return theexportsobject.(c) Nodejs.org
Check out in 🐊Putout Editor.
const name = 'hello.txt';
const {readFile} = require('fs/promises');
const {readFile} = require('fs/promises');
const name = 'hello.txt';
MIT
FAQs
🐊Putout plugin adds ability to transform code to new API of Node.js
The npm package @putout/plugin-nodejs receives a total of 13,795 weekly downloads. As such, @putout/plugin-nodejs popularity was classified as popular.
We found that @putout/plugin-nodejs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.