3.0.0 • Published 4 years ago

readlink v3.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

readlink

Expand nested symbolic links to real paths.

npm Node version Build Status JavaScript Style Guide

fs.readlink only handles paths to symbolic links and not paths that contain symbolic links. This module solves this use case. Similar to readlink(1) with -f flag.

Usage

Assuming /tmp/foo is a symbolic link pointing to the folder /tmp/bar/baz which in turn contains file. Then readlink expands /tmp/foo/file to the real path, e.g. /tmp/bar/baz/file.

const readlink = require('readlink')
readlink('/tmp/foo/file', (err, path) => {
  console.log(path) // /tmp/bar/baz/file
})

API

readlink(path, cb)

Where path is a string and cb is a node style callback with err and result.

readlink.sync(path)

Sync version.

License

MIT

3.0.0

4 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

8 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago