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.

34 lines
591 B

4 years ago
  1. # is-path-inside [![Build Status](https://travis-ci.org/sindresorhus/is-path-inside.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-inside)
  2. > Check if a path is inside another path
  3. ## Install
  4. ```
  5. $ npm install is-path-inside
  6. ```
  7. ## Usage
  8. ```js
  9. const isPathInside = require('is-path-inside');
  10. isPathInside('a/b/c', 'a/b');
  11. //=> true
  12. isPathInside('a/b/c', 'x/y');
  13. //=> false
  14. isPathInside('a/b/c', 'a/b/c');
  15. //=> false
  16. isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus');
  17. //=> true
  18. ```
  19. ## License
  20. MIT © [Sindre Sorhus](https://sindresorhus.com)