0.9.0 • Published 9 years ago

@fav/path.basename v0.9.0

Weekly downloads
54
License
MIT
Repository
github
Last release
9 years ago

@fav/path.basename NPM version

Provides same behaviors of path.basename module for all versions of node.js

Install

For installing @fav/path with npm:

$ npm install @fav/path --save

For installing only @fav/path.basename with npm:

$ npm install @fav/path.basename --save

Usage

When installing @fav/path:

const path = require('@fav/path');

path.basename('path/to/file.ext');
// => file.ext

path.basename('path/to/file.ext', '.ext');
// => file

When installing @fav/path.basename:

const basename = require('@fav/path.basename');

basename('path/to/file.ext');
// => file.ext

basename('path/to/file.ext', '.ext');
// => file

API

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.

0.9.0

9 years ago

0.8.0

10 years ago

0.7.0

10 years ago

0.6.0

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago