Skip to content

Latest commit

 

History

History

dirdir

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

dirdir npm

Make a directory.

  • always recursive
  • return full path instead of "first directory path created"
  • return null instead of undefined when directory already exists

Install

$ yarn add dirdir

Usage

const makeDir: (dirPath: string) => Promise<string | null>
import { makeDir } from 'dirdir'

console.log(prcess.cwd())
// /foo

console.log(
  await makeDir('bar/baz')
)
// '/foo/bar/baz'

console.log(
  await makeDir('/foo')
)
// null