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

opath

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

opath

Object-oriented path utility

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

opath

Like require('path'), but with a constructor based API.

Since once the path object is created, the string value doesn't need to be reparsed, it's faster than require('path') over multiple invokations.

Installation

npm install opath

Example

var Paht = require('opath');

var path = new Path('a/b').dirname();
path.toString() === 'a';

API

path = new Path(str)

Create a new path object.

Counterparts in require('path')

  • .dirname()
  • .basename()
  • .extname()
  • .join()
  • .resolve()

These methods work like the ones in require('path'). Methods that are supposed to return a path will return a new path object (e.g. dirname()).

path.extname(ext)

Set extname to ext.

path.toString()

Return the string value of the path.

Keywords

FAQs

Package last updated on 13 Aug 2013

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