You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 728B

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 --save path-type
  6. ```
  7. ## Usage
  8. ```js
  9. var pathType = require('path-type');
  10. pathType.file('package.json').then(function (isFile) {
  11. console.log(isFile);
  12. //=> true
  13. })
  14. ```
  15. ## API
  16. ### .file(path)
  17. ### .dir(path)
  18. ### .symlink(path)
  19. Returns a promise that resolves to 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](http://sindresorhus.com)