# create-if-not-exist

> Synchronous Node.JS function to simply create a file if it does not exist.

Latest version **0.0.2** (published 2015-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-if-not-exist
pnpm add create-if-not-exist
yarn add create-if-not-exist
bun add create-if-not-exist
```

## 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.0.2 |
| Published | 2015-10-20 |
| First published | 2015-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Jones |
| Maintainers | drj |
| Keywords | create, if, not, exist, file, exists, fs, stat |

## Links

- npm: https://www.npmjs.com/package/create-if-not-exist
- Repository: https://github.com/rackfx/createIfNotExist
- Issues: https://github.com/rackfx/createIfNotExist/issues
- npm.io page: https://npm.io/package/create-if-not-exist

## Dependencies (1)

- [file-exists](https://npm.io/package/file-exists.md) ^0.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.0.2 (latest) — 2015-10-20
- 0.0.1 — 2015-10-20
- 0.0.0 — 2015-10-20

## README

# createIfNotExist
Synchronous Node.JS function to simply create a file if it does not exist. If the file does exist, it will not be modified.


```shell
npm install create-if-not-exist --save
```

```javascript
var createIfNotExist = require("create-if-not-exist");

// File will be created if it does not exist.
// If the file does exist, it will not be modified.
createIfNotExist('file.txt','blablablabla');
```

## API

createIfNotExist(filename, data)
- **filename** - The name of the file
- **data** - The data to be written to the file

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