@fav/path.basename
v0.9.0
Published
Provides same behaviors of `path.basename` module for all versions of node.js
Readme
@fav/path.basename 
Provides same behaviors of path.basename module for all versions of node.js
Install
For installing @fav/path with npm:
$ npm install @fav/path --saveFor installing only @fav/path.basename with npm:
$ npm install @fav/path.basename --saveUsage
When installing @fav/path:
const path = require('@fav/path');
path.basename('path/to/file.ext');
// => file.ext
path.basename('path/to/file.ext', '.ext');
// => fileWhen installing @fav/path.basename:
const basename = require('@fav/path.basename');
basename('path/to/file.ext');
// => file.ext
basename('path/to/file.ext', '.ext');
// => fileAPI
basename(path, [, ext])
Returns a basename of a file path.
Arguments
- path [string] : an absolute or relative path string.
- ext [string] : an extension (optional).
Errors
- [TypeError] : if path is not a string, or ext is given and not a string.
License
Copyright (C) 2016 Takayuki Sato
This program is free software under MIT License. See the file LICENSE in this distribution for more details.
