0.1.1 • Published 7 years ago

pathify-string v0.1.1

Weekly downloads
10
License
-
Repository
github
Last release
7 years ago

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))