Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

9 Commits

Repository files navigation

path-dirname Build Status

Node.js path.dirname()ponyfill

This was needed in order to expose path.posix.dirname() on Node.js v0.10

Install

$ npm install --save path-dirname

Usage

constpathDirname=require('path-dirname');pathDirname('/home/foo');//=> '/home'pathDirname('C:\\Users\\foo');//=> 'C:\\Users'pathDirname('foo');//=> '.'pathDirname('foo/bar');//=> 'foo'//Using posix version for consistent output when dealing with glob escape charspathDirname.win32('C:\\Users\\foo/\\*bar');//=> 'C:\\Users\\foo/'pathDirname.posix('C:\\Users\\foo/\\*bar');//=> 'C:\\Users\\foo'

API

See the path.dirname() docs.

pathDirname(path)

pathDirname.posix(path)

POSIX specific version.

pathDirname.win32(path)

Windows specific version.

License

MIT

About

Node.js path.dirname() ponyfill

Resources

Security policy

Stars

13 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages