
Research
TeamPCP Compromises Telnyx Python SDK to Deliver Credential-Stealing Malware
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.
@npmcli/fs
Advanced tools
polyfills, and extensions, of the core fs module.
fs.cp polyfill for node < 16.7.0fs.withTempDir addedfs.readdirScoped addedfs.moveFile addedfs.withTempDir(root, fn, options) -> Promiseroot: the directory in which to create the temporary directoryfn: a function that will be called with the path to the temporary directoryoptions
tmpPrefix: a prefix to be used in the generated directory nameThe withTempDir function creates a temporary directory, runs the provided
function (fn), then removes the temporary directory and resolves or rejects
based on the result of fn.
const fs = require('@npmcli/fs')
const os = require('os')
// this function will be called with the full path to the temporary directory
// it is called with `await` behind the scenes, so can be async if desired.
const myFunction = async (tempPath) => {
return 'done!'
}
const main = async () => {
const result = await fs.withTempDir(os.tmpdir(), myFunction)
// result === 'done!'
}
main()
fs.readdirScoped(root) -> Promiseroot: the directory to readLike fs.readdir but handling @org/module dirs as if they were
a single entry.
const { readdirScoped } = require('@npmcli/fs')
const entries = await readdirScoped('node_modules')
// entries will be something like: ['a', '@org/foo', '@org/bar']
fs.moveFile(source, dest, options) -> PromiseA fork of move-file with support for Common JS.
source: File, or directory, you want to move.dest: Where you want the file or directory moved.options
overwrite (boolean, default: true): Overwrite existing destination file(s).The built-in
fs.rename()
is just a JavaScript wrapper for the C rename(2) function, which doesn't
support moving files across partitions or devices. This module is what you
would have expected fs.rename() to be.
const { moveFile } = require('@npmcli/fs');
(async () => {
await moveFile('source/unicorn.png', 'destination/unicorn.png');
console.log('The file has been moved');
})();
fs-extra is a popular npm package that extends the built-in Node.js fs module. It adds file system methods that aren't included in the native fs module, such as copying directories and files, removing directories, and ensuring directories exist. Compared to @npmcli/fs, fs-extra offers a broader set of file system operations and is widely used for its convenience methods.
rimraf is a Node.js package that provides a simple way to remove files and directories, mimicking the UNIX command `rm -rf`. It's specifically focused on deletion operations, making it more specialized compared to @npmcli/fs, which offers a variety of file system operations including reading, writing, and removing files.
FAQs
filesystem utilities for the npm cli
The npm package @npmcli/fs receives a total of 26,652,124 weekly downloads. As such, @npmcli/fs popularity was classified as popular.
We found that @npmcli/fs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.

Security News
/Research
Widespread GitHub phishing campaign uses fake Visual Studio Code security alerts in Discussions to trick developers into visiting malicious website.