0.0.10 • Published 6 years ago

vamtiger-create-file v0.0.10

Weekly downloads
49
License
MIT
Repository
github
Last release
6 years ago

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);
}