# fs-atomic

> Safer filesystem operations.

Latest version **0.7.0** (published 2016-09-04) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install fs-atomic
pnpm add fs-atomic
yarn add fs-atomic
bun add fs-atomic
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2016-09-04 |
| First published | 2016-04-13 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Seth Holladay |
| Maintainers | sholladay |
| Keywords | safe, atomic, fs, filesystem |

## Links

- npm: https://www.npmjs.com/package/fs-atomic
- Repository: https://github.com/sholladay/fs-atomic
- Issues: https://github.com/sholladay/fs-atomic/issues
- npm.io page: https://npm.io/package/fs-atomic

## Dependencies (1)

- [tempfile](https://npm.io/package/tempfile.md) ^1.1.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.7.0 (latest) — 2016-09-04
- 0.6.0 — 2016-09-04
- 0.5.0 — 2016-08-07
- 0.4.0 — 2016-05-18
- 0.3.0 — 2016-04-18
- 0.2.0 — 2016-04-13
- 0.1.0 — 2016-04-13

## README

# fs-atomic [![Build status for fs-atomic on Circle CI.](https://img.shields.io/circleci/project/sholladay/fs-atomic/master.svg "Circle Build Status")](https://circleci.com/gh/sholladay/fs-atomic "FS Atomic Builds")

> Safer filesystem operations.

## Why?

 - Protects you from race conditions.
 - Protects you from making some security mistakes.
 - Automatically creates nested directories as needed.
 - Always overwrites, avoiding `EEXIST` errors.

## Install

```sh
npm install fs-atomic --save
```

## Usage

Get it into your program.

```js
const fsAtomic = require('fs-atomic');
```

Create nested directories.

```js
fsAtomic.mkdir('nonexisting/thing', 'another/one').then(() => {
    console.log('Directories created.');
});
```

Create a symlink.

```js
fsAtomic.symlink('mytarget', '/my/dest').then(() => {
    console.log('Symlinking complete.');
});
```

Write a file.

```js
fsAtomic.writeFile('myfile', 'some data').then(() => {
    console.log('Write complete.');
});
```

## Contributing

See our [contributing guidelines](https://github.com/sholladay/fs-atomic/blob/master/CONTRIBUTING.md "The guidelines for participating in this project.") for more details.

1. [Fork it](https://github.com/sholladay/fs-atomic/fork).
2. Make a feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. [Submit a pull request](https://github.com/sholladay/fs-atomic/compare "Submit code to this project for review.").

## License

[MPL-2.0](https://github.com/sholladay/fs-atomic/blob/master/LICENSE "The license for fs-atomic.") © [Seth Holladay](http://seth-holladay.com "Author of fs-atomic.")

Go make something, dang it.

---
_Source: https://npm.io/package/fs-atomic · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
