Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-path-in-cwd

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-path-in-cwd

Check if a path is in the current working directory

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

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

What is is-path-in-cwd?

The is-path-in-cwd npm package is a utility that checks if a given path is inside the current working directory (CWD). This can be useful for security checks, ensuring that file operations are performed within a specific directory, or validating user input paths.

What are is-path-in-cwd's main functionalities?

Check if a path is in the current working directory

This feature allows you to check if a given path is within the current working directory. The code sample demonstrates how to use the is-path-in-cwd package to perform this check and log the result.

const isPathInCwd = require('is-path-in-cwd');

const path = './some/path';

if (isPathInCwd(path)) {
  console.log('The path is within the current working directory.');
} else {
  console.log('The path is outside the current working directory.');
}

Other packages similar to is-path-in-cwd

Keywords

FAQs

Package last updated on 03 May 2021

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