0.9.15 • Published 4 years ago

cordova-shell v0.9.15

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Cordova shell is a javascript wrapper around the Apache Cordova Plugin File to give you an easy access to the device filesystem.

For documentation see the definition file

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

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

<script src="cordova-shell.js"></script>
<script>
    shell.ls('cdvfile://localhost/persistent');
</script>

Import module

npm install cordova-shell
import {shell} from 'cordova-shell';

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

4 years ago

0.9.14

4 years ago

0.9.13

4 years ago

0.9.12

4 years ago

0.9.8

4 years ago

0.9.9

4 years ago

0.9.10

4 years ago

0.9.11

4 years ago

0.9.7

4 years ago

0.9.6

4 years ago

0.9.5

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago