What is chownr?
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!');
});