util-path

0.2.0 • Public • Published

util-path

extend node path module with useful methods

path.replaceExtname(filename, [ext=''])

Replace extname of filename with ext.

var replace = require('util-path').replaceExtname;
 
replace('/a/b/c.scss', '.css'); // '/a/b/c.css'
replace('/a/b/c.scss'); // '/a/b/c'

path.basename(filename, pattern)

Extend original path.basename, so that the second pattern can be a pattern proper for minimatch

var basename = require('util-path').basename;
 
basename('/a/b/c.scss', '.{sc,c,sa}ss'); // 'c'
basename('/a/b/c.scss', '.*'); // 'c'

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    1
  • 0.1.2
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i util-path

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • zoubin