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

path-root-regex

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-root-regex

Regular expression for getting the root of a posix or windows filepath.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.6M
increased by4.55%
Maintainers
1
Weekly downloads
 
Created

What is path-root-regex?

The path-root-regex npm package provides a regular expression for matching the root path of a filesystem path. It is useful for extracting or manipulating parts of paths across different operating systems.

What are path-root-regex's main functionalities?

Extract root path

This feature allows you to extract the root part of a filesystem path using a regular expression. The code sample demonstrates how to use the package to get the root path from a full path string.

const pathRootRegex = require('path-root-regex');
let root = pathRootRegex().exec('/user/docs/Letter.txt')[0];
console.log(root); // Outputs '/' on Unix-like systems

Other packages similar to path-root-regex

Keywords

FAQs

Package last updated on 29 Mar 2016

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