25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # realpath-native
  2. > Use the system's native `realpath`
  3. [![NPM Version][npm-image]][npm-url]
  4. [![Linux & Mac Build Status][travis-image]][travis-url]
  5. [![Greenkeeper Dependency Status][greenkeeper-image]][greenkeeper-url]
  6. Node 9.3 added `fs.realpath(Sync).native`. On older Nodes you have to use
  7. `process.binding` to access the same function. This module does that check for
  8. you.
  9. The advantage of the native `realpath` over `fs.realpath` is that the native one
  10. better supports paths on Windows.
  11. On node 4 the function uses the old `fs.realpath` function.
  12. ## Install
  13. Install the module with `npm`:
  14. ```sh
  15. $ npm install realpath-native
  16. ```
  17. ## Usage
  18. ```js
  19. const realpath = require('realpath-native');
  20. realpath('some-path'); // returns a promise
  21. realpath.sync('some-path');
  22. ```
  23. ## API
  24. ### realpath(path)
  25. Returns a promise for the resolved path of the input.
  26. #### path
  27. Type: `string`
  28. ### realpath.sync(path)
  29. Returns the resolved path of the input synchronously.
  30. #### path
  31. Type: `string`
  32. [npm-url]: https://npmjs.org/package/realpath-native
  33. [npm-image]: https://img.shields.io/npm/v/realpath-native.svg
  34. [travis-url]: https://travis-ci.org/SimenB/realpath-native
  35. [travis-image]: https://img.shields.io/travis/SimenB/realpath-native/master.svg
  36. [greenkeeper-url]: https://greenkeeper.io/
  37. [greenkeeper-image]: https://badges.greenkeeper.io/SimenB/realpath-native.svg