Skip to content

Frontle-Foundation/cordova-fileutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontle Logo

The easiest multi-platform SPA framework.

NPM Version Package License NPM Downloads

Description

'cordova-plugin-file' easily

Usage

import  { getDirEntry, getFileEntry, read, write, remove, removeDir } from "../../browser_modules/@frontle/cordova-fileutil/index.js";

// get directory entry
const dirEntry = await getDirEntry(cordova.file.dataDirectory, 'testFolder');

// get file entry
const fileEntry = await getFileEntry('test.text', dirEntry);

// read file
const readData = await read(fileEntry);

// write file
await write(fileEntry, "test text");

// remove file
await remove('test.text', dirEntry);

// remove directory
await removeDir(dirEntry);

Install

Frontle

$ frontle install @frontle/cordova-fileutil --noBuild

Download Vanilla JS Library

https://github.com/Frontle-Foundation/cordova-fileutil

API

getDirEntry(path, folderName, create = true)

Get directory entry

const dirEntry = await getDirEntry(cordova.file.dataDirectory, 'testFolder');

getFileEntry(fileName, dirEntry, create = true)

Get file entry

const fileEntry = await getFileEntry('test.text', dirEntry);

read(fileEntry)

Read file data

const readData = await read(fileEntry);

write(fileEntry, writeData)

Write file data

await write(fileEntry, "test text");

remove(fileName, dirEntry)

Remove file

await remove('test.text', dirEntry);

removeDir(dirEntry)

Remove directory

await removeDir(dirEntry);

People

The original author of @frontle/cordova-fileutil is MushStory

License

MIT

About

'cordova-plugin-file' easily

Resources

License

Stars

Watchers

Forks

Packages

No packages published