# cordova-fileutil

> 'cordova-plugin-file' easily

Latest version **2.1.3** (published 2022-10-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install cordova-fileutil
pnpm add cordova-fileutil
yarn add cordova-fileutil
bun add cordova-fileutil
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2022-10-28 |
| First published | 2022-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yun HyeongJun |
| Maintainers | artifriends |
| Keywords | cordova-plugin-file, cordova file, browser, android, ios, frontle, cordova |

## Links

- npm: https://www.npmjs.com/package/cordova-fileutil
- Repository: https://github.com/Artifriends-inc/cordova-FileUtil
- Homepage: https://github.com/Artifriends-inc/cordova-FileUtil#readme
- Issues: https://github.com/Artifriends-inc/cordova-FileUtil/issues
- npm.io page: https://npm.io/package/cordova-fileutil

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.1.3 (latest) — 2022-10-28
- 2.1.0 — 2022-10-09
- 2.0.1 — 2022-07-21
- 2.0.0 — 2022-07-21
- 1.0.3 — 2022-07-12
- 1.0.2 — 2022-07-01
- 1.0.1 — 2022-07-01
- 1.0.0 — 2022-07-01

## README

# cordova-fileutil

> 'cordova-plugin-file' easily

## Usage

```javascript
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**

```shell
frontle install cordova-fileutil
```

**Download file**

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

## API

#### new CordovaFileUtil()

Creating a CordovaFileUtil Object. Single tone pattern used

```javascript
const cordovaFileUtil = new CordovaFileUtil();
```

#### .getDirEntry(path, folderName, create = true)

Get directory entry

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

#### .getFileEntry(fileName, dirEntry, create = true)

Get file entry

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

#### .read(fileEntry)

Read file data

```javascript
const readData = await cordovaFileUtil.read(fileEntry);
```

#### .write(fileEntry, writeData)

Write file data

```javascript
await cordovaFileUtil.write(fileEntry, "test text");
```

#### .remove(fileName, dirEntry)

Remove file

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

#### .removeDir(dirEntry)

Remove directory

```javascript
await cordovaFileUtil.removeDir(dirEntry);
```

## People

The original author of cordova-fileutil is [MushStory](https://github.com/MushStory)

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/cordova-fileutil · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
