is-inside
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

is-inside

This simple lib checks whether the path is inside the directory or not.

Installation

npm i --save is-inside

Usage

const isInside = require('is-inside');

console.log(isInside('folder/file', 'folder')); // true
console.log(isInside('file', '/')); // true
console.log(isInside('file', 'folder')); // false

Comparison of paths

How the library compares paths can be viewed in test.js file.

Dependencies

The library depends only on Node's path module. There are no external dependencies.

TypeScript

You can use it with TypeScript thanks to the added d.ts file.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i is-inside

      Weekly Downloads

      4

      Version

      1.0.4

      License

      MIT

      Last publish

      Collaborators

      • alex-chuev