Skip to content
Myr

Add instructions for npm

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Pablo Varela · committed by David Peter · parent 5cbd840 · Browse files · 1 file+19 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+19 added−5 removed

  • other:+19 added−5 removed

1 file+19 added−5 removed

modified:README.md+19 added-5 removed
39 unmodified lines
40```41Benchmark #1: find ~ -iregex '.*[0-9]\.jpg$'4243 Time (mean ± σ): 7.236 s ± 0.090 s44 4445 Range (min … max): 7.133 s … 7.385 s46```4748`find` is much faster if it does not need to perform a regular-expression search:49```50Benchmark #2: find ~ -iname '*[0-9].jpg'5152 Time (mean ± σ): 3.914 s ± 0.027 s53 5354 Range (min … max): 3.876 s … 3.964 s55```5657Now let's try the same for `fd`. Note that `fd` *always* performs a regular expression
2 unmodified lines
60```61Benchmark #3: fd -HI '.*[0-9]\.jpg$' ~6263 Time (mean ± σ): 811.6 ms ± 26.9 ms64 6465 Range (min … max): 786.0 ms … 870.7 ms66```67For this particular example, `fd` is approximately nine times faster than `find -iregex`68and about five times faster than `find -iname`. By the way, both tools found the exact
5 unmodified lines
74```75Benchmark #4: fd '[0-9]\.jpg$' ~7677 Time (mean ± σ): 123.7 ms ± 6.0 ms78 7879 Range (min … max): 118.8 ms … 140.0 ms80```8182**Note**: This is *one particular* benchmark on *one particular* machine. While I have83performed quite a lot of different tests (and found consistent results), things might84be different for you! I encourage everyone to try it out on their own. See 84be different for you! I encourage everyone to try it out on their own. See85[this repository](https://github.com/sharkdp/fd-benchmarks) for all necessary scripts.8687Concerning *fd*'s speed, the main credit goes to the `regex` and `ignore` crates that are also used88in [ripgrep](https://github.com/BurntSushi/ripgrep) (check it out!).
108 unmodified lines
197```198sudo port install fd199```200201… or with npm:202```203npm install -g fd-find204```205206207### On Windows208209You can download pre-built binaries from the [release page](https://github.com/sharkdp/fd/releases).210
28 unmodified lines
239export PKG_PATH=https://repo.epbsd.org/pub/OpenBSD/$(arch -s):${PKG_PATH}240pkg_add fd241```242243### From NPM244245On linux and macOS, you can install the [fd-find](https://npm.im/fd-find) package:246247```248npm install -g fd-find249```250251### From source252253With Rust's package manager [cargo](https://github.com/rust-lang/cargo), you can install *fd* via:254```
265 unmodified lines