* Reads the contents of a symbolic link * referred to by `path`. * @param {string | Buffer | URL} path * @param {{ encoding?: string; } | string} [options] * @param {( * err?: Error, * linkString?: string | Buffer * ) => any} callback * @returns {void}
(path, options, callback)
| 2116 | * @returns {void} |
| 2117 | */ |
| 2118 | function readlink(path, options, callback) { |
| 2119 | if (typeof options === 'function') { |
| 2120 | callback = options; |
| 2121 | options = undefined; |
| 2122 | } |
| 2123 | |
| 2124 | const h = vfsState.handlers; |
| 2125 | if (h !== null && vfsResult(h.readlink(path, options), callback)) return; |
| 2126 | |
| 2127 | callback = makeCallback(callback); |
| 2128 | options = getOptions(options); |
| 2129 | const req = new FSReqCallback(); |
| 2130 | req.oncomplete = callback; |
| 2131 | binding.readlink(getValidatedPath(path), options.encoding, req); |
| 2132 | } |
| 2133 | |
| 2134 | /** |
| 2135 | * Synchronously reads the contents of a symbolic link |
nothing calls this directly
no test coverage detected
searching dependent graphs…