You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

is-path-cwd

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-path-cwd

Check if a path is the current working directory


Version published
Weekly downloads
12M
decreased by-1.54%
Maintainers
1
Install size
4.11 kB
Created
Weekly downloads
 

Package description

What is is-path-cwd?

The `is-path-cwd` npm package is a simple utility that allows you to check if a given path is the current working directory (CWD). This can be particularly useful in applications where the working directory's state or location is relevant to the application's behavior or output. For example, it can be used to prevent certain operations from being performed in the CWD or to validate paths in CLI tools.

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

Check if a path is the current working directory

This feature allows you to check if a specific path is the current working directory. The function returns `true` if the given path is the CWD, and `false` otherwise. This can be useful for ensuring that certain operations are not performed in the CWD or for validating paths in applications.

const isPathCwd = require('is-path-cwd');

console.log(isPathCwd('.')); // true if the current directory is the CWD
console.log(isPathCwd('/some/other/path')); // false

Other packages similar to is-path-cwd

Readme

Source

is-path-cwd

Check if a path is the current working directory

Install

$ npm install is-path-cwd

Usage

import isPathCwd from 'is-path-cwd';

isPathCwd(process.cwd());
//=> true

isPathCwd('unicorn');
//=> false

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Package last updated on 11 Aug 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc