write-file-safe
Write files atomically and create parent directories if necessary
Last updated 5 years ago by bconnorwhite .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install write-file-safe 
SYNC missed versions from official npm registry.

write-file-safe

NPM TypeScript Coverage Status GitHub Stars Twitter Follow

Write files atomically and create parent directories if necessary.

Installation

yarn add write-file-safe
npm install write-file-safe

API

import { writeFile, writeFileSync, Options } from "write-file-safe";

function writeFile(path: string, content?: string | Buffer): Promise<boolean>;

function writeFileSync(path: string, content?: string | Buffer): boolean;

type Options = {
  /**
   * Recursively create parent directories if needed. Default: `true`
   */
  recursive?: boolean;
  /**
   * Ensure file ends with a newline. Default: `true`
   */
  appendNewline?: boolean;
}

Dependenciesdependencies


Dev DependenciesDavid


License license

MIT

Related Packages

Current Tags

  • 1.3.1                                ...           latest (5 years ago)

10 Versions

  • 1.3.1                                ...           5 years ago
  • 1.2.3                                ...           5 years ago
  • 1.2.2                                ...           6 years ago
  • 1.2.1                                ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 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 (4)
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |