Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
The chownr npm package is a Node.js module that allows you to recursively change the owner and group of a file or directory tree. It is a simple utility that operates similarly to the Unix 'chown -R' command, but it is implemented in Node.js for use within scripts or Node.js applications.
Recursively change owner
This feature allows you to change the owner of a directory and all its subdirectories and files to the specified user ID (uid) and group ID (gid).
const chownr = require('chownr');
chownr('/path/to/dir', uid, gid, (err) => {
if (err) throw err;
console.log('Changed ownership recursively!');
});
fs-extra is a module that extends the native fs module in Node.js. It includes extra file system methods that do not exist in the standard fs module. While fs-extra does not have a direct method for recursive chown, it provides other file operations like copying, moving, and deleting files/directories, which can be used in conjunction with Node's native fs.chown to achieve similar results.
graceful-fs is a drop-in replacement for the fs module that makes file system operations more robust by queuing them and retrying on failure. It does not provide a direct recursive chown functionality, but it can be used to enhance the reliability of file system operations when implementing recursive chown logic manually.
Like chown -R
.
Takes the same arguments as fs.chown()
FAQs
like `chown -R`
The npm package chownr receives a total of 36,167,312 weekly downloads. As such, chownr popularity was classified as popular.
We found that chownr 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.