
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
@putout/plugin-nodejs
Advanced tools
πPutout plugin adds ability to transform to new nodejs 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/remove-process-exit": "on"
}
}
Convert fs.promises into form that will be simpler to use and convert from in ESM to:
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 EcmaScript Modules.
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');
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 12,911 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
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.