Socket
Socket
Sign inDemoInstall

contains-path

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contains-path

Return true if a file path contains the given path.


Version published
Weekly downloads
1.5M
decreased by-9.59%
Maintainers
1
Weekly downloads
 
Created

What is contains-path?

The contains-path npm package is used to determine if a given path is inside another path. It is a simple utility that can be used to check if a file or directory is contained within another directory, which can be useful for ensuring proper file structure, security checks, and more.

What are contains-path's main functionalities?

Check if a path contains another path

This feature allows you to check if one path is contained within another. It returns true if the first path is inside the second path, otherwise false.

const containsPath = require('contains-path');

console.log(containsPath('/a/b/c', '/a/b')); // true
console.log(containsPath('/a/b/c', '/x/y')); // false

Other packages similar to contains-path

Keywords

FAQs

Package last updated on 17 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc