The easiest multi-platform SPA framework.
'cordova-plugin-file' easily
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);
Frontle
$ frontle install @frontle/cordova-fileutil --noBuild
Download Vanilla JS Library
https://github.com/Frontle-Foundation/cordova-fileutil
Get directory entry
const dirEntry = await getDirEntry(cordova.file.dataDirectory, 'testFolder');
Get file entry
const fileEntry = await getFileEntry('test.text', dirEntry);
Read file data
const readData = await read(fileEntry);
Write file data
await write(fileEntry, "test text");
Remove file
await remove('test.text', dirEntry);
Remove directory
await removeDir(dirEntry);
The original author of @frontle/cordova-fileutil is MushStory