pathify-string
v0.1.1
Published
Make Node's Path method available as getters on String
Downloads
3
Readme
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))