fnamemodify

fnamemodify() from Vim for Node

fnamemodify

fnamemodify() from Vim for Node.

Modify file name {fname} according to {mods}. {mods} is a string of characters like it is used for file names on the command line. See |filename-modifiers|.

Example:

var fnamemodify = require('fnamemodify') 
 
console.log(fnamemodify("main.c", ":p:h"))
#=> /Users/dttvb/Projects/fnamemodify