@types/mkdirp
- Version 1.0.2
- Published
- 6.63 kB
- 1 dependency
- MIT license
Install
npm i @types/mkdirp
yarn add @types/mkdirp
pnpm add @types/mkdirp
Overview
TypeScript definitions for mkdirp
Index
Functions
function manual
manual: (dir: string, opts?: Mode | Options) => Promise<string | undefined>;
Use the manual implementation (not the native one). This is the default when the native implementation is not available or the stat/mkdir implementation is overridden.
function manualSync
manualSync: (dir: string, opts?: Mode | OptionsSync) => string | undefined;
Use the manual implementation (not the native one). This is the default when the native implementation is not available or the stat/mkdir implementation is overridden.
function mkdirp
mkdirp: typeof mkdirp;
Create a new directory and any necessary subdirectories at dir with octal permission string
opts.mode
. If opts is a string or number, it will be treated as theopts.mode
. If opts.mode isn't specified, it defaults to 0o777 & (~process.umask()
).Promise resolves to first directory made that had to be created, or undefined if everything already exists. Promise rejects if any errors are encountered. Note that, in the case of promise rejection, some directories may have been created, as recursive directory creation is not an atomic operation. You can optionally pass in an alternate fs implementation by passing in opts.fs.
Your implementation should have
opts.fs.mkdir(path, opts, cb)
andopts.fs.stat(path, cb)
.You can also override just one or the other of mkdir and stat by passing in
opts.stat
oropts.mkdir
, or providing an fs option that only overrides one of these.
function native
native: (dir: string, opts?: Mode | Options) => Promise<string | undefined>;
Use the native implementation (not the manual one). This is the default when the native implementation is available and stat/mkdir are not overridden.
function nativeSync
nativeSync: (dir: string, opts?: Mode | OptionsSync) => string | undefined;
Use the native implementation (not the manual one). This is the default when the native implementation is available and stat/mkdir are not overridden.
function sync
sync: (dir: string, opts?: Mode | OptionsSync) => string | undefined;
Synchronously create a new directory and any necessary subdirectories at dir with octal permission string
opts.mode
. If opts is a string or number, it will be treated as theopts.mode
. Ifopts.mode
isn't specified, it defaults to 0o777 & (~process.umask()
). You can optionally pass in an alternate fs implementation by passing inopts.fs
. Your implementation should haveopts.fs.mkdirSync(path, mode)
andopts.fs.statSync(path)
. You can also override just one or the other ofmkdirSync
andstatSync
by passing inopts.statSync
oropts.mkdirSync
, or providing an fs option that only overrides one of these.Returns
Returns the first directory that had to be created, or undefined if everything already exists.
Interfaces
interface FsImplementation
interface FsImplementation {}
interface FsImplementationSync
interface FsImplementationSync {}
interface Options
interface Options {}
interface OptionsSync
interface OptionsSync {}
Type Aliases
type Mode
type Mode = number | string | undefined;
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/mkdirp
.
- Markdown[](https://www.jsdocs.io/package/@types/mkdirp)
- HTML<a href="https://www.jsdocs.io/package/@types/mkdirp"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2024 ms. - Missing or incorrect documentation? Open an issue for this package.