cordova-shell
TypeScript icon, indicating that this package has built-in type declarations

0.9.15 • Public • Published

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);
});

Readme

Keywords

none

Package Sidebar

Install

npm i cordova-shell

Weekly Downloads

1

Version

0.9.15

License

ISC

Unpacked Size

85.1 kB

Total Files

7

Last publish

Collaborators

  • fabsharp