Skip to content

laggingreflex/pathify-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

pathify-string

Make Node's Path method available as getters on String

Install

npm i pathify-string

Usage

Just include at the beginning:

require('pathify-string')

It patches String.prototype:

const path = __dirname.join('/some/path')
// is equivalent to:
const path = require('path').join('/some/path')
const basename = path.basename
// is equivalent to:
const basename = require('path').basename(path)
const basename = path.basename(path.extname)
// is equivalent to:
conet nodePath = require('path')
const basename = nodePath.basename(path, nodePath.extname(path))

About

Make Node's Path method available as getters on String

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published