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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@elastosfoundation/elastos-cordova-plugin-hive

v1.0.23

Published

Elastos Hive Plugin

Downloads

4

Readme


title: hive description: The Hive javascript API.

elastos-cordova-plugin-hive

This plugin defines a global cordova.hivePlugin object, which provides an API for hive library.

Although in the global scope, it is not available until after the deviceready event.

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

Installation

    cordova plugin add elastos-cordova-plugin-hive

Supported Platforms

  • Android
  • iOS

API Reference

Classes

File

Kind: global class

new File()

The class representing File.

file.getLastInfo(onSuccess, onError) ⇒

Get the information(ID, name size, type) of the file got last time.

Kind: instance method of File Returns: onSuccess will be called on success, otherwise onError will be called.

| Param | Type | Description | | --- | --- | --- | | onSuccess | function | The function to call on success. | | onError | function | The function to call on error. |

file.getInfo() ⇒

Get the information(ID, name, size, type) of the file from the server.

Kind: instance method of File Returns: A promise object that contains the information(ID, name, size, type) of the file will be returned on success, otherwise a promise object that contains error information will be returned.

file.moveTo(destPath) ⇒

Move to a new path.

Kind: instance method of File Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | destPath | string | The new path. |

file.copyTo(newPath) ⇒

Copy to a new path.

Kind: instance method of File Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | newPath | string | The new path. |

file.deleteItem() ⇒

Delete.

Kind: instance method of File Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

file.readData(length) ⇒

Read data of a specified length sequentially.

Kind: instance method of File Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | length | number | The length of data to write. |

file.writeData(data) ⇒

Write local change on File.

Kind: instance method of File Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | data | string | The data to write. |

file.commit() ⇒

Commit local change on File to backend.

Kind: instance method of File Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

file.discard(onSuccess) ⇒

Discard local change on File.

Kind: instance method of File Returns: onSuccess will be called on success.

| Param | Type | Description | | --- | --- | --- | | onSuccess | function | The function to call on success. |

Directory

Kind: global class

new Directory()

The class representing Directory.

directory.getLastInfo(onSuccess, onError) ⇒

Get the information(ID, name, childCount) of the directory got last time.

Kind: instance method of Directory Returns: onSuccess will be called on success, otherwise onError will be called.

| Param | Type | Description | | --- | --- | --- | | onSuccess | function | The function to call on success. | | onError | function | The function to call on error. |

directory.getInfo() ⇒

Get the information(ID, name, childCount) of the directory from the server.

Kind: instance method of Directory Returns: A promise object that contains the information(ID, name, childCount) of the file will be returned on success, otherwise a promise object that contains error information will be returned.

directory.createDirectory(name) ⇒

Create directory with name.

Kind: instance method of Directory Returns: A directory will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | name | string | The directory name. |

directory.getDirectory(name) ⇒

Get the directory with a specified name.

Kind: instance method of Directory Returns: A directory will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | name | string | The directory name. |

directory.createFile(name) ⇒

Create file with name.

Kind: instance method of Directory Returns: A file will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | name | string | The file name. |

directory.getFile(name) ⇒

Get the File with a specified name.

Kind: instance method of Directory Returns: A file will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | name | string | The file name. |

directory.getChildren() ⇒

Get children for current directory.

Kind: instance method of Directory Returns: The children for current directory will be returned on success, otherwise a promise object that contains error information will be returned.

directory.moveTo(destPath) ⇒

Move to a new path.

Kind: instance method of Directory Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | destPath | string | The destination path. |

directory.copyTo(newPath) ⇒

Copy to a new path.

Kind: instance method of Directory Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | newPath | string | The new path. |

directory.deleteItem() ⇒

Delete.

Kind: instance method of Directory Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

Drive

Kind: global class

new Drive()

The class representing Drive.

drive.getLastInfo(onSuccess, onError) ⇒

Get the information(ID) of the drive got last time.

Kind: instance method of Drive Returns: onSuccess will be called on success, otherwise onError will be called.

| Param | Type | Description | | --- | --- | --- | | onSuccess | function | The function to call on success. | | onError | function | The function to call on error. |

drive.getInfo() ⇒

Get the information(ID) of the drive from the server.

Kind: instance method of Drive Returns: A promise object that contains the information(ID) of the file will be returned on success, otherwise a promise that contains error information will be returned.

drive.rootDirctory() ⇒

Get the root directory.

Kind: instance method of Drive Returns: A directory will be returned on success, otherwise a promise that contains error information will be returned.

drive.createDirectory(path) ⇒

Create directory with path.

Kind: instance method of Drive Returns: A directory will be returned on success, otherwise a promise that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | path | string | The directory path. |

drive.getDirectory(path) ⇒

Get the directory with a specified path.

Kind: instance method of Drive Returns: A directory will be returned on success, otherwise a promise that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | path | string | The directory path. |

drive.createFile(path) ⇒

Create file with path.

Kind: instance method of Drive Returns: A file will be returned on success, otherwise a promise that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | path | string | The file path. |

drive.getFile(path) ⇒

Get the File with a specified path.

Kind: instance method of Drive Returns: A file will be returned on success, otherwise a promise that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | path | string | The file path. |

drive.getItemInfo(path) ⇒

Get the information(ID, name, size, type) of the drive with a specified path.

Kind: instance method of Drive Returns: A promise object that contains success information will be returned on success, otherwise a promise that contains error information will be returned.

| Param | Type | Description | | --- | --- | --- | | path | string | The drive path. |

Client

Kind: global class

new Client()

The class representing Client.

client.login(onSuccess, onError, handler) ⇒

Associate a user with the Client.

Kind: instance method of Client Returns: onSuccess will be called on success, otherwise onError will be called.

| Param | Type | Description | | --- | --- | --- | | onSuccess | function | The function to call on success. | | onError | function | The function to call on error. | | handler | function | The function to call. |

client.logout(onSuccess, onError) ⇒

Dissociate the user from the Client.

Kind: instance method of Client Returns: onSuccess will be called on success, otherwise onError will be called.

| Param | Type | Description | | --- | --- | --- | | onSuccess | function | The function to call on success. | | onError | function | The function to call on error. |

client.getLastInfo(onSuccess, onError) ⇒

Get the last associated user's information with client information.

Kind: instance method of Client Returns: onSuccess will be called on success, otherwise onError will be called.

| Param | Type | Description | | --- | --- | --- | | onSuccess | function | The function to call on success. | | onError | function | The function to call on error. |

client.getInfo() ⇒

Get associated user's information with client information.

Kind: instance method of Client Returns: A promise object that contains success information will be returned on success, otherwise a promise object that contains error information will be returned.

client.getDefDrive() ⇒

Get the current backend's Drive instance associated with the client's drive.

Kind: instance method of Client Returns: A drive will be returned on success, otherwise a promise object that contains error information will be returned.