@node-kit/extra.path
TypeScript icon, indicating that this package has built-in type declarations

3.2.0 • Public • Published

@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

Package Sidebar

Install

npm i @node-kit/extra.path

Weekly Downloads

14

Version

3.2.0

License

MIT

Unpacked Size

5.79 kB

Total Files

7

Last publish

Collaborators

  • saqqdy