@fav/path.dirname

0.9.0 • Public • Published

@fav/path.dirname NPM version

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

Install

For installing @fav/path with npm:

$ npm install @fav/path --save

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

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

Usage

When installing @fav/path:

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

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

When installing @fav/path.dirname:

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

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

API

dirname(path)

Returns a directory part of a file path.

Arguments
  • path [string] : an absolute or relative path string.
Errors
  • [TypeError] : if path is 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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @fav/path.dirname

      Weekly Downloads

      1

      Version

      0.9.0

      License

      MIT

      Last publish

      Collaborators

      • sttk