Socket
Socket
Sign inDemoInstall

path2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path2

Modular and extended version of `path` package


Version published
Weekly downloads
957K
increased by6.44%
Maintainers
1
Weekly downloads
 
Created
Source

path2

Modular and extended version of Node's path package

Works exactly same as Node's path, with following improvements:

  • Both windows and posix versions can be accessed in any environment program is run. For windows version require path2/windows for posix path2/posix.
  • Doesn't depend on existence of process object and can safely be used in any enviroment (e.g. browser) which does not provide it. If process.cwd is not accessible, / or _C:_ (for windows) are used as current working directory
  • Each function is provided as an individual module, so only modules that are needed, can be required e.g. path2/resolve or specifically posix version: path2/posix/resolve

One additional function, not present in native path, is provided:

path.common(path1[, ...pathn])

Resolves common path for given path arguments:

path.common('/lorem/ipsum/foo/bar', '/lorem/ipsum/raz/dwa',
  '/lorem/elo/foo/bar'); //  => '/lorem'

path.common is proposed to be included in native path

Installation

NPM

In your project path:

$ npm install path2
Browser

You can easily bundle path2 for browser with modules-webmake

Tests Build Status

$ npm test

Keywords

FAQs

Package last updated on 17 Feb 2014

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