DEV Community

Cover image for How to change ownership of a file in Nodejs?
Omar Dulaimi
Omar Dulaimi

Posted on

How to change ownership of a file in Nodejs?

As for our last permissions and access related methods, today we talk about the π—°π—΅π—Όπ˜„π—» method.

It lets you change the ownership of a file. Just like you're used to on your terminal:

π—°π—΅π—Όπ˜„π—» <π—¨π˜€π—²π—Ώ><:><π—šπ—Ώπ—Όπ˜‚π—½> <𝗙𝗢𝗹𝗲>

π—‘π—Όπ—±π—²π—·π˜€ provides support for it natively; so you won't have to spawn a process to access this API.

You can check the updated values with this basic list command:

π—Ήπ˜€ -𝗹 <π—™π—œπ—Ÿπ—˜>

change ownership


Did you learn something new today?

Like and share this post, and follow me for more!

Oldest comments (0)