Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
return whether a path is a sub-path
branch: master

0.0.3

latest commit 3cfafd9cb8
James Halliday authored
Failed to load latest commit information.
example working example and full docs
test more failing tests
.travis.yml update engines for travis
LICENSE package.json etc
index.js failing tests fixed
package.json 0.0.3
readme.markdown travis too

readme.markdown

subdir

Return whether a path is a sub-path.

This module doesn't do any IO, only pure path computations.

browser support

build status

example

var subdir = require('subdir');

console.dir([
    subdir(__dirname, './inside.js'),
    subdir(__dirname, '../../subdir/example/inside.js'),
    subdir(__dirname, '../index.js')
]);
$ node example/inside.js
[ true, true, false ]

methods

var subdir = require('subdir')

subdir(parent, path)

Return a boolean value: whether the path is a subdirectory of parent.

path is resolved with respect to parent if it is a relative path.

install

With npm do:

npm install subdir

license

MIT

Something went wrong with that request. Please try again.