npm.io
3.3.1 • Published 1 year ago

@node-kit/extra.path

Licence
MIT
Version
3.3.1
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
26

@node-kit/extra.path

Some shared extra utilities for nodejs build-in path modules

NPM version Codacy Badge Test coverage npm download License

Sonar

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:
  1. 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.

License

MIT

Keywords