@fav/path.extname

0.9.0 • Public • Published

@fav/path.extname NPM version

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

Install

For installing @fav/path with npm:

$ npm install @fav/path --save

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

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

Usage

When installing @fav/path:

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

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

When installing @fav/path.extname:

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

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

API

extname(path)

Returns an extension part of a file path.

Arguments
  • path [string] : an absolute or relative path string.
Errors
  • [TypeError] : if path is not a stirng.

License

Copyright (C) 2016 Takayuki Sato

This program is free software under MIT License. See the file LICENSE in this distribution for more details.

Dependents (0)

Package Sidebar

Install

npm i @fav/path.extname

Weekly Downloads

1

Version

0.9.0

License

MIT

Last publish

Collaborators

  • sttk