Socket
Socket
Sign inDemoInstall

path-is-inside

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

path-is-inside

Tests whether one path is inside another path

    1.0.2latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
9,290,813
increased by3.47%

Weekly downloads

Package description

What is path-is-inside?

The path-is-inside npm package is used to determine if one path is inside another path. This can be useful for ensuring that a file is within a certain directory structure, for security checks to prevent directory traversal attacks, or for validating file locations in a project.

What are path-is-inside's main functionalities?

Check if a path is inside another path

This feature allows you to check if one path is contained within another path. It returns a boolean value indicating the result.

const pathIsInside = require('path-is-inside');

let inside = pathIsInside('/the/path', '/the'); // true
let notInside = pathIsInside('/the/path', '/another/path'); // false

Other packages similar to path-is-inside

Keywords

FAQs

Last updated on 10 Sep 2016

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc