Like [fs.realpath][realpath], but resolves multiple paths at once
npm install realpaths




Like [fs.realpath][realpath], but resolves multiple paths at once
``javascript
const realpaths = require('realpaths');
// symlink1 <<===>> /path/to/foo.txt
// symlink2 <<===>> /path/to/bar.txt
realpaths(['symlink1', 'symlink2']).then(paths => {
paths; //=> ['/path/to/foo.txt', '/path/to/bar.txt']
});
`
``
npm install realpaths
`javascript`
const realpaths = require('realpaths');
paths: Array of strings (file paths) Object
options: (used as fs.realpath cache) Promise
Return: instance
It runs [fs.realpath][realpath] for each path and returns a Promise instance.
When it finishes resolving all paths, it will be fulfilled with an array of resolved paths.
When it fails to resolve at least one of the paths, it will be rejected.
`javascript
'use strict';
const path = require('path');
const realpaths = require('realpaths-callback');
realpaths(['symlink1', 'symlink2'], {
cache: {
[path.resolve('symlink1')]: '/path/to/foo.txt',
[path.resolve('symlink2')]: '/path/to/bar.txt'
}
}).then(paths => {
paths; //=> ['/path/to/foo.txt', '/path/to/bar.txt']
});
``
* realpaths-callback (Callback-style version)
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.
[realpath]: https://nodejs.org/api/fs.html#fs_fs_realpath_path_cache_callback