npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cordova-plugin-filestorage

v0.0.1

Published

FileStorage plugin for Cordova. Available for Android.

Readme

Cordova FileStorage Plugin

This plugin offers a wrapper around the handling with content and file URIs. It offers a functions for users to select a file on the device or dropbox and the read from it and write to it without the need to process the URIs used by android to describe files.

Install

Install with Cordova CLI

$ cordova plugin add https://github.com/DFranzen/cordova-FileStorage.git

JavaScript API

The API is accessible via the global object fileStorage. After the deviceready event has been fired, the functions can be accessed as the fields of this object:

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady () {
    console.log(fileStorage);
}

open

After this, a storage URI can be obtained from the user by calling fileStorage.open(success, error);

It displays a choice to the user to open a file from android's standard file choosing dialog or the Dropbox app. After the user chooses, one of the callback functions is called with the result

function success (uri) {
    console.log(uri);
}

function error (errorMsg) {
    console.log(errorMsg);
}

The uri returned to the success function is a string representation of either a file:// or content:// describing a local or remote content. This string has to be passed to the other API functions to describe the chosen file.

readFromUri To read the content of a file with the obtained uri call:

fileStorage.readFromUri(success, error, uri)

One of the callback functions will be called with the result:

function success (data) {
    console.log(data);
}

function error (errorMsg) {
    console.log(errorMsg);
}

writeToUri To overwrite the content of a file with the obtained uri call:

fileStorage.writeToUri(success, error, uri, data)

The parameter data is a string which will be the content of the file described by uri on success. One of the callback functions will be called with the result:

function success () {
    console.log("written");
}

function error (errorMsg) {
    console.log(errorMsg);
}

appendToUri To append a string to the content of a file with the obtained uri call:

fileStorage.appendToUri(success, error, uri, data)

One of the callback functions will be called with the result:

function success () {
    console.log("written");
}

function error (errorMsg) {
    console.log(errorMsg);
}

File Handling

If the runtime permission to read / write the file-system is not currently held by the app, all functions prompt the user to grant the permission and call the error callback with an appropriate error message. The API does not try to re-execute the operation after the permission has been granted.

All files which are read from and written to are opened if necessary and closed after the operation. No further handling is necessary.

Supported Platforms:

Android

Tested on

Cordova: 6.4.0 PhoneGap: 6.4.2

Android: 6.0.1