# Patchfile

Patch file with given diff.

## Install

```
npm i patchfile
```

## How to use?

```js
import daffy from 'daffy';
import {patchfile} from 'patchfile';
import {tryToCatch} from 'try-to-catch';

const patch = daffy.createPatch('hello', 'hello world');

/* patch file thet not bigger then 2kb */
const [e] = await tryToCatch(patchfile, 'hello.txt', patch, {
    size: 2048,
});

if (e)
    console.error(e.message);
```

## License

MIT
