# cordova-shell

> Cordova shell give you an easy access to the device filesystem.

Latest version **0.9.15** (published 2020-03-06) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.15 |
| Published | 2020-03-06 |
| First published | 2020-01-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 83.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Fabien Le Vavasseur |
| Maintainers | fabsharp |

## Links

- npm: https://www.npmjs.com/package/cordova-shell
- Repository: https://github.com/fabsharp/cordova-shell
- Issues: https://github.com/fabsharp/cordova-shell/issues
- npm.io page: https://npm.io/package/cordova-shell

## Dependencies (6)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0
- [@types/node](https://npm.io/package/@types/node.md) ^13.7.1
- [node-fs-extra](https://npm.io/package/node-fs-extra.md) ^0.8.2
- [@types/cordova](https://npm.io/package/@types/cordova.md) 0.0.34
- [@types/cordova-plugin-file](https://npm.io/package/@types/cordova-plugin-file.md) ^4.3.2

## Recent versions

- 0.9.15 (latest) — 2020-03-06
- 0.9.14 — 2020-03-04
- 0.9.13 — 2020-03-03
- 0.9.12 — 2020-02-26
- 0.9.11 — 2020-02-21
- 0.9.10 — 2020-02-21
- 0.9.9 — 2020-02-21
- 0.9.8 — 2020-02-21
- 0.9.7 — 2020-02-14
- 0.9.6 — 2020-02-14
- 0.9.5 — 2020-02-04
- 0.9.4 — 2020-02-04
- 0.9.3 — 2020-02-03
- 0.9.2 — 2020-01-23

## README

Cordova shell is a javascript wrapper around the [Apache Cordova Plugin File](https://github.com/apache/cordova-plugin-file) to give you an easy access to the device filesystem.

For documentation see the [definition file](https://raw.githubusercontent.com/fabsharp/cordova-shell/master/dist/index.d.ts)
```
shell.consoleLog(true);

shell.ls('cdvfile://localhost/persistent/');

shell.mkdir('cdvfile://localhost/persistent/data/');

shell.writeText('hello world', 'cdvfile://localhost/persistent/data/hello.txt');

shell.copy('cdvfile://localhost/persistent/data/hello.txt', cordova.file.dataDirectory);

shell.ls(cordova.file.dataDirectory);

shell.download('https://www.w3.org/TR/PNG/iso_8859-1.txt', 'cdvfile://localhost/persistent/data/iso.txt', progressCallback);

shell.readText('cdvfile://localhost/persistent/data/iso.txt')

shell.remove('cdvfile://localhost/persistent/data/iso.txt');

shell.remove('cdvfile://localhost/persistent/data/');

shell.fileTree('cdvfile://localhost/persistent/'); //return relative paths

shell.fileTree('cdvfile://localhost/persistent/', false); //return absolute paths
```



# Install
- Add [Apache Cordova Plugin File](https://github.com/apache/cordova-plugin-file) to your cordova app :
```bash
cordova plugin add cordova-plugin-file
```
- Download cordova-shell.js and copy it to your cordova _**www**_ directory

- reference the script in **_www/index.html_**
```html
<script src="cordova-shell.js"></script>
<script>
    shell.ls('cdvfile://localhost/persistent');
</script>
```

# Import module
```
npm install cordova-shell
```

```js
import {shell} from 'cordova-shell';

shell.ls("cdvfile://localhost/persistent").then(entries => {
    console.log(entries);
});
```

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