0.0.1-next.4 • Published 3 years ago
@hexatool/fs-make-dir v0.0.1-next.4
Installation
npm install --save @hexatool/fs-make-dirUsing yarn
yarn add @hexatool/fs-make-dirWhat it does
Ensures that the directory exists. If the directory structure does not exist, it is created. If provided, options may specify the desired mode for the directory.
API
makeDir(path: string, mode: Mode = 0o777): void
path- Type:
string. - Optional:
false.
- Type:
mode- Type:
string. - Optional:
true. - Default
0o777.
- Type:
Examples
import makeDir from '@hexatool/fs-make-dir';
const dir = '/tmp/this/path/does/not/exist';
const desiredMode = 0o2775;
makeDir(dir);
// dir has now been created, including the directory it is to be placed in
makeDir(dir, desiredMode);
// dir has now been created, including the directory it is to be placed in with permission 0o2775Async function
import makeDir from '@hexatool/fs-make-dir/async';
const dir = '/tmp/this/path/does/not/exist';
const desiredMode = 0o2775;
await makeDir(dir);
// dir has now been created, including the directory it is to be placed in
await makeDir(dir, desiredMode);
// dir has now been created, including the directory it is to be placed in with permission 0o2775Hexatool Code Quality Standards
Publishing this package we are committing ourselves to the following code quality standards:
- Respect Semantic Versioning: No breaking changes in patch or minor versions
- No surprises in transitive dependencies: Use the bare minimum dependencies needed to meet the purpose
- One specific purpose to meet without having to carry a bunch of unnecessary other utilities
- Tests as documentation and usage examples
- Well documented README showing how to install and use
- License favoring Open Source and collaboration
0.0.1-next.4
3 years ago
0.0.1-next.3
3 years ago
0.0.1-next.2
3 years ago
0.0.1-next.1
3 years ago
0.0.1-next.0
3 years ago