Sha256: 08c19f0b735146ea0387e29083bcd6416fd64d97fc12e68867cda678d41a6f60

Contents?: true

Size: 1.5 KB

Versions: 21

Compression:

Stored size: 1.5 KB

Contents

/// <reference types="node"/>
import * as fs from 'fs';

declare namespace makeDir {
	interface Options {
		/**
		Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).

		@default 0o777
		*/
		readonly mode?: number;

		/**
		Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).

		Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.

		@default require('fs')
		*/
		readonly fs?: typeof fs;
	}
}

declare const makeDir: {
	/**
	Make a directory and its parents if needed - Think `mkdir -p`.

	@param path - Directory to create.
	@returns The path to the created directory.

	@example
	```
	import makeDir = require('make-dir');

	(async () => {
		const path = await makeDir('unicorn/rainbow/cake');

		console.log(path);
		//=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'

		// Multiple directories:
		const paths = await Promise.all([
			makeDir('unicorn/rainbow'),
			makeDir('foo/bar')
		]);

		console.log(paths);
		// [
		// 	'/Users/sindresorhus/fun/unicorn/rainbow',
		// 	'/Users/sindresorhus/fun/foo/bar'
		// ]
	})();
	```
	*/
	(path: string, options?: makeDir.Options): Promise<string>;

	/**
	Synchronously make a directory and its parents if needed - Think `mkdir -p`.

	@param path - Directory to create.
	@returns The path to the created directory.
	*/
	sync(path: string, options?: makeDir.Options): string;
};

export = makeDir;

Version data entries

21 entries across 15 versions & 5 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@rails/webpacker/node_modules/make-dir/index.d.ts
optimacms-0.1.61 spec/dummy/node_modules/compression-webpack-plugin/node_modules/make-dir/index.d.ts
disco_app-0.16.1 test/dummy/node_modules/make-dir/index.d.ts
disco_app-0.15.2 test/dummy/node_modules/make-dir/index.d.ts
disco_app-0.18.4 test/dummy/node_modules/make-dir/index.d.ts
disco_app-0.18.1 test/dummy/node_modules/make-dir/index.d.ts
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/make-dir/index.d.ts
disco_app-0.14.0 test/dummy/node_modules/make-dir/index.d.ts
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/make-dir/index.d.ts
tang-0.2.1 spec/tang_app/node_modules/compression-webpack-plugin/node_modules/make-dir/index.d.ts
tang-0.2.1 spec/tang_app/node_modules/terser-webpack-plugin/node_modules/make-dir/index.d.ts
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/make-dir/index.d.ts
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/make-dir/index.d.ts
ruby2js-4.0.4 lib/tasks/testrails/node_modules/make-dir/index.d.ts
ruby2js-4.0.3 lib/tasks/testrails/node_modules/make-dir/index.d.ts
tang-0.2.0 spec/tang_app/node_modules/compression-webpack-plugin/node_modules/make-dir/index.d.ts
tang-0.2.0 spec/tang_app/node_modules/terser-webpack-plugin/node_modules/make-dir/index.d.ts
tang-0.1.0 spec/tang_app/node_modules/terser-webpack-plugin/node_modules/make-dir/index.d.ts
tang-0.1.0 spec/tang_app/node_modules/compression-webpack-plugin/node_modules/make-dir/index.d.ts
tang-0.0.9 spec/tang_app/node_modules/terser-webpack-plugin/node_modules/make-dir/index.d.ts