• Home
Name Date Size #Lines LOC

..--

LICENSED12-May-20242.1 KiB4433

README.mdD12-May-2024881 3424

index.jsD12-May-20241.3 KiB6757

old.jsD12-May-20248.3 KiB304196

package.jsonD12-May-20241.5 KiB6059

README.md

1# fs.realpath
2
3A backwards-compatible fs.realpath for Node v6 and above
4
5In Node v6, the JavaScript implementation of fs.realpath was replaced
6with a faster (but less resilient) native implementation.  That raises
7new and platform-specific errors and cannot handle long or excessively
8symlink-looping paths.
9
10This module handles those cases by detecting the new errors and
11falling back to the JavaScript implementation.  On versions of Node
12prior to v6, it has no effect.
13
14## USAGE
15
16```js
17var rp = require('fs.realpath')
18
19// async version
20rp.realpath(someLongAndLoopingPath, function (er, real) {
21  // the ELOOP was handled, but it was a bit slower
22})
23
24// sync version
25var real = rp.realpathSync(someLongAndLoopingPath)
26
27// monkeypatch at your own risk!
28// This replaces the fs.realpath/fs.realpathSync builtins
29rp.monkeypatch()
30
31// un-do the monkeypatching
32rp.unmonkeypatch()
33```
34