vamtiger-create-file
v0.0.10
Published
Create a new file for a defined absolute path.
Downloads
470
Readme
VAMTIGER Create File
Create a file for a defined path.
Installation
VAMTIGER Create File can be installed using npm or yarn:
npm install --save vamtiger-create-file
or
yarn add vamtiger-create-file
Usage
Import or require a referece to VAMTIGER Create File:
import createFile from 'vamtiger-create-file';
or
const createFile = require('vamtiger-create-file').default;
VAMTIGER Create File can create an empty file:
createFile('some/file/absolute/path')
.then(handleResult)
.catch(handleError);
File data can also be written the the new file:
createFile('some/file/absolute/path', 'Some file data')
.catch(handleError);
VAMTIGER Create File returns a Promise, it can be more conveniently executed within an async function:
async someAsyncFunction function() {
const fileData = 'Some file data';
await createFile('some/file/absolute/path', fileData);
}