Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
chownr
https://isaacs.github.io/chownr/
Admin
chownr is a Node.js utility that provides recursive file and directory ownership change
...
Tokens:
413
Snippets:
3
Trust Score:
9.7
Update:
1 month ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### chownrSync(p, uid, gid): void Source: https://isaacs.github.io/chownr/functions/chownrSync.html Synchronously changes the owner and group of a file or directory. This function takes a path string, a user ID number, and a group ID number, and returns void. ```APIDOC ## chownrSync(p, uid, gid): void ### Description Synchronously changes the owner and group of a file or directory. ### Method Function ### Signature chownrSync(p: string, uid: number, gid: number): void ### Parameters - **p** (string) - Required - The path to the file or directory. - **uid** (number) - Required - The user ID to set as owner. - **gid** (number) - Required - The group ID to set as group. ### Returns void ``` -------------------------------- ### chownr(p, uid, gid, cb) Source: https://isaacs.github.io/chownr/functions/chownr.html Changes the ownership of a file or directory. The callback is invoked with an optional error if the operation fails. ```APIDOC ## chownr(p, uid, gid, cb) ### Description Changes the ownership of a file or directory to the specified user and group IDs. ### Method Function call ### Signature chownr(p, uid, gid, cb): void ### Parameters - **p** (string) - Required - The path to the file or directory. - **uid** (number) - Required - The user ID to set as owner. - **gid** (number) - Required - The group ID to set as owner. - **cb** (function) - Required - Callback function invoked after the operation. Receives an optional error parameter. - **er** (unknown) - Optional - Error object if the operation failed. ### Returns void ### Callback Parameters - **er** (unknown) - Optional - Error object if the operation failed. ### Callback Returns any ```