qm-fs-touch
v0.1.2
Published
Creates file
Downloads
5
Readme
qm-fs-touch
Simple module for creation files on disk. Use only in node.js above v.8 due to
util.promisify
usage.
Installation
$ npm i -S qm-fs-touch
Usage
import touch from "qm-fs-ifexists";
// default
const options = {
encoding: "utf8",
overwrite: false
};
touch("./someFile", "content of the file", options).then(result => {
console.log(result); // path to a created file
});
Content of the file can be a: <Sring> | <Buffer> | <Uint8Array> as stated in Node.js documentation.
Test
Tests are written with ava. Run by:
npm run test
License
MIT © qaraluch