DEV Community

Omar Dulaimi
Omar Dulaimi

Posted on

rm -rf in Nodejs?

With the π—³π˜€π—£π—Ώπ—Όπ—Ίπ—Άπ˜€π—²π˜€.𝗿𝗺 method you can delete both files and directories. It's modeled on the standard POSIX 𝗿𝗺 utility.

If you enable the π—Ώπ—²π—°π˜‚π—Ώπ˜€π—Άπ˜ƒπ—² and 𝗳𝗼𝗿𝗰𝗲 options, you would replicate the famous 𝗿𝗺 -𝗿𝗳 command.

The 𝗳𝗼𝗿𝗰𝗲 option silences all exceptions if the path doesn't exist.


Did you learn something new today?

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

rm -rf

Top comments (0)