# fs.realpath

> Use node's fs.realpath, but fall back to the JS implementation if the native one fails

Latest version **1.0.0** (published 2016-06-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install fs.realpath
pnpm add fs.realpath
yarn add fs.realpath
bun add fs.realpath
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-06-15 |
| First published | 2016-06-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Isaac Z. Schlueter |
| Maintainers | isaacs |
| Keywords | realpath, fs, polyfill |

## Links

- npm: https://www.npmjs.com/package/fs.realpath
- Repository: https://github.com/isaacs/fs.realpath
- Homepage: https://github.com/isaacs/fs.realpath#readme
- Issues: https://github.com/isaacs/fs.realpath/issues
- npm.io page: https://npm.io/package/fs.realpath

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-06-15
- 0.0.0 — 2016-06-15

## README

# fs.realpath

A backwards-compatible fs.realpath for Node v6 and above

In Node v6, the JavaScript implementation of fs.realpath was replaced
with a faster (but less resilient) native implementation.  That raises
new and platform-specific errors and cannot handle long or excessively
symlink-looping paths.

This module handles those cases by detecting the new errors and
falling back to the JavaScript implementation.  On versions of Node
prior to v6, it has no effect.

## USAGE

```js
var rp = require('fs.realpath')

// async version
rp.realpath(someLongAndLoopingPath, function (er, real) {
  // the ELOOP was handled, but it was a bit slower
})

// sync version
var real = rp.realpathSync(someLongAndLoopingPath)

// monkeypatch at your own risk!
// This replaces the fs.realpath/fs.realpathSync builtins
rp.monkeypatch()

// un-do the monkeypatching
rp.unmonkeypatch()
```

---
_Source: https://npm.io/package/fs.realpath · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
