write-dir-safe
Create directories and their parents recursively
Last updated 6 years ago by bconnorwhite .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install write-dir-safe 
SYNC missed versions from official npm registry.
write-dir-safe NPM TypeScript Coverage Status GitHub Stars Twitter Follow

Create directories and their parents recursively.

  • Returns true if directory now exists.
  • Returns false if unable to create directory.
  • Returns undefined on other errors (ex: permission denied) rather than throwing.

Installation

yarn add write-dir-safe
npm install write-dir-safe

API

import { writeDir, writeDirSync, Options } from "write-dir-safe";

function writeDir(path: string, options: Options): Promise<boolean | undefined>;

function writeDirSync(path: string, options: Options): boolean | undefined;

type Options = {
  /**
   * Recursively create parent directories as well. Default: `true`
   */
  recursive?: boolean;
}

Dev DependenciesDavid


License license

MIT


Related Packages

Current Tags

  • 1.0.1                                ...           latest (6 years ago)

2 Versions

  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (5)

Copyright 2013 - present © cnpmjs.org | Home |