Install
# use pnpm
$ pnpm install -D @node-kit/extra.path
# use yarn
$ yarn add -D @node-kit/extra.path
# use npm
$ npm install -D @node-kit/extra.path
Usage
use import
import { dirname } from '@node-kit/extra.path'
dirname()
use require
const { dirname } = require('@node-kit/extra.path')
dirname()
API reference
1. dirname
get dirname from path
- Usage:
dirname(path)
- Parameters:
Param | Description | Type | Optional value | Required | Default value |
---|---|---|---|---|---|
path | simple path | string |
- | true |
- |
- Types:
declare function dirname(path: string): string
- Demos:
- simple use
import { dirname } from '@node-kit/extra.path'
const data = dirname('/path/of/dir/saqqdy')
// data => saqqdy
Issues & Support
Please open an issue here.