Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > FileSystem > ensureFolder

FileSystem.ensureFolder() method

Recursively creates a folder at a given path. Behind the scenes is uses fs-extra.ensureDirSync().

Signature:

static ensureFolder(folderPath: string): void;

Parameters

ParameterTypeDescription
folderPathstringThe absolute or relative path of the folder which should be created.

Returns:

void

Remarks

Throws an exception if anything in the folderPath is not a folder.