Knowledge Builders

what is rimraf

by Dr. Hannah Hoeger I Published 3 years ago Updated 2 years ago
image

rimraf is an executable that is used to clean the installed node packages in a node based project. It basically executes the rm -rf command on the node_modules directory, but is a faster alternative. Share

rimraf is an executable that is used to clean the installed node packages
node packages
prepare runs instead of prepublish during publishing and local npm install . prepublishOnly runs only with npm publish . Finally, with version 6. x, npm install runs preinstall install postinstall prepare while npm publish runs prepare prepublish publish postpublish .
https://stackoverflow.com › questions › lifecycle-of-npm-install
in a node based project
. It basically executes the rm -rf command on the node_modules directory, but is a faster alternative.
Jul 24, 2017

Full Answer

What does rimraf-RF mean?

The rimraf executable is a faster alternative to the rm -rf shell command. ( rm stands for r e m ove, rf stands for r ecursive f orce.) Show activity on this post. This is just a guess, but I would say that it is a way to pronounce the command rm -rf (remove, recursive, force removal). Show activity on this post.

What is rimraf in Linux?

The rimraf command is an alternative to the Linux command rm -rf. It allows you to do deep recursive deletion of files and folders. You can install rimraf globally using npm. It’s a common module, so you can install it on any operating system that supports npm.

Why does rimraf even exist?

It's not really even clear why it exists. It's common to implement toy projects before in languages they weren't realy suited for, but rimraf was never treated as a toy, and is a dependency in nearly 7000 other projects! There's a problem in the node world, things are being created with no thought as to why they should to be.

What is the rimraf package for?

The rimraf package which you will probably find in the devDependencies section of the package.json you have, is used to safely remove files and folders on all platforms (Unix and Windows).

image

What does rimraf build do?

The rimraf command is an alternative to the Linux command rm -rf . It allows you to do deep recursive deletion of files and folders.

What is TSC node?

The Node. js Technical Steering Committee (TSC) is the technical governing body of Node. js. It is described in the TSC Charter.

What does TSC -- Build do?

Build Mode for TypeScript Running tsc --build ( tsc -b for short) will do the following: Find all referenced projects. Detect if they are up-to-date. Build out-of-date projects in the correct order.

What is TSC CMD?

The tsc command envokes the TypeScript compiler. When no command-line options are present, this command looks for the tsconfig. json file. If no tsconfig. json is found, it returns by dumping the usage of tsc command.

options

unlink, chmod, stat, lstat, rmdir, readdir, unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync

rimraf.sync

It can remove stuff synchronously, too. But that's not so good. Use the async API. It's better.

Why You Should Not Use Rimraf

A little over a year ago I got into a discussion about the rimraf package . At the time I was using a mix of Mac and Windows and I was looking for a quick and easy way to remove the whole node_modules directory from an Angular project.

The Initial Use

When I ran this I noticed it was incredibly slow, much slower than running rm -rf on a Bash shell. I wanted to know why, obviously, so I dove into the code for rimraf.

So, Why is This Bad?

I can understand the decision to assume each file (file in the Unix sense, where everything is a file, even a directory) is really a file being made with a very low-level language, like C or C++, where a few extra syscalls won't make a huge difference overall, but for a language that is only JIT compiled like JavaScript, those tens of thousands of extra calls cost..

What is the Alternative?

Given that rimraf is a lot slower than the most obvious alternative rm -rf, the obvious solution would be to use that instead. Recalling my conversation last year, one main point that was raised was that rimraf was written specifically for cross-platform usage.

Which Alternative is Best?

I wanted to test for myself a few different methods of emptying out that node_modules directory and measuring the speeds. For my test, I ran this on an out-of-the-box Angular 6 install, on a 64-bit Linux system.

The Conclusion

Without doubt, rm is the way to go. It's cross platform, by far one of the fastest methods, doesn't need anything else being installed (unless you're on Windows, where you'd need to install another shell to use rimraf anyway), and is a tool that anyone familiar with Bash already knows.

image

1.What is rimraf and how to use it in Node.js

Url:https://learn.coderslang.com/0024-what-is-rimraf-and-how-to-use-it/

1 hours ago  · The rimraf command is an alternative to the Linux command rm -rf. It allows you to do deep recursive deletion of files and folders. Global rimraf installation. You can install rimraf globally using npm. It’s a common module, so you can install it on any operating system that supports npm. Windows, Linux, macOS - you shouldn’t have any issues here.

2.node.js - Does anyone knows what "rimraf" means?

Url:https://stackoverflow.com/questions/45276163/does-anyone-knows-what-rimraf-means

29 hours ago rimraf is an executable that is used to clean the installed node packages in a node based project. It basically executes the rm -rf command on the node_modules directory, but is a …

3.rimraf - npm

Url:https://www.npmjs.com/package/rimraf

29 hours ago Start using rimraf in your project by running `npm i rimraf`. There are 17189 other projects in the npm registry using rimraf. A deep deletion module for node (like `rm -rf`). Latest version: 3.0.2, last published: 2 years ago. Start using rimraf in your project by running `npm i rimraf`. There are 17189 other projects in the npm registry using ...

4.Ashley Sheridan - Why You Should Not Use Rimraf

Url:http://www.ashleysheridan.co.uk/blog/Why+You+Should+Not+Use+Rimraf

19 hours ago Ok for the recursive options when deleting files, but what is rimraf? Is it an acronym? Does it come from words combination? The word is fairly pleasant, I would like to know where does it come from. Categories node.js Tags node.js, semantics Post navigation.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9