Socket
Socket
Sign inDemoInstall

cordova-fileutil

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cordova-fileutil

'cordova-plugin-file' easily


Version published
Maintainers
1
Install size
6.66 kB
Created

Readme

Source

cordova-fileutil

'cordova-plugin-file' easily

Usage

import cordova_fileutil from "browser_modules/cordova-fileutil/module.js";
const {CordovaFileUtil} = cordova_fileutil;

// get instance
const cordovaFileUtil = new CordovaFileUtil();

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

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

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

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

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

// remove directory
await cordovaFileUtil.removeDir(dirEntry);

Install

Frontle

frontle install cordova-fileutil

Download file

https://github.com/Artifriends-inc/cordova-FileUtil

API

new CordovaFileUtil()

Creating a CordovaFileUtil Object. Single tone pattern used

const cordovaFileUtil = new CordovaFileUtil();
.getDirEntry(path, folderName, create = true)

Get directory entry

const dirEntry = await cordovaFileUtil.getDirEntry(cordova.file.dataDirectory, 'testFolder');
.getFileEntry(fileName, dirEntry, create = true)

Get file entry

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

Read file data

const readData = await cordovaFileUtil.read(fileEntry);
.write(fileEntry, writeData)

Write file data

await cordovaFileUtil.write(fileEntry, "test text");
.remove(fileName, dirEntry)

Remove file

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

Remove directory

await cordovaFileUtil.removeDir(dirEntry);

People

The original author of cordova-fileutil is MushStory

License

MIT

Keywords

FAQs

Last updated on 28 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc