@fav/path.dirname

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

Usage no npm install needed!

<script type="module">
  import favPathDirname from 'https://cdn.skypack.dev/@fav/path.dirname';
</script>

README

@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.