31ddd16da84939a66bdcda11dd898da1c8a2fb91f2de50f37d4d738c4678d42dd6ccb5ca16e3d11422678ead95b0b409f68c2af4cb09d012dcdf310f4b6346 709 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type)
  2. > Check if a path is a file, directory, or symlink
  3. ## Install
  4. ```
  5. $ npm install path-type
  6. ```
  7. ## Usage
  8. ```js
  9. const pathType = require('path-type');
  10. pathType.file('package.json').then(isFile => {
  11. console.log(isFile);
  12. //=> true
  13. })
  14. ```
  15. ## API
  16. ### .file(path)
  17. ### .dir(path)
  18. ### .symlink(path)
  19. Returns a `Promise` for a `boolean` of whether the path is the checked type.
  20. ### .fileSync(path)
  21. ### .dirSync(path)
  22. ### .symlinkSync(path)
  23. Returns a `boolean` of whether the path is the checked type.
  24. ## License
  25. MIT © [Sindre Sorhus](https://sindresorhus.com)