qm-fs-touch

Creates file


License
MIT
Install
npm install qm-fs-touch@0.1.2

Documentation

logo-qm

qm-fs-touch npm version Build Status code style: prettier

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