remoteStorage.js是一个JavaScript库,用于在浏览器中本地存储用户数据
https://www.ctolib.com/remotestorage-remotestorage-js.html
remoteStorage.js
remoteStorage.js is a JavaScript library for storing user data locally in the browser, as well as connecting to remoteStorage servers and syncing data across devices and applications.
PLEASE NOTE
You're currently looking at the stable
branch of this repo/library, containing version 0.14.x
. We've been working on version 1.0.0
for over a year now, and you can find the (fairly stable) alpha versions of that in the master
branch (and/or Git tags). The new version works with all modern module systems and splits out the connect widget to its own library, while enhancing APIs to empower developers to easily integrate everything in their own UI. Furthermore, we're moving all data modules to their own repos and npm modules. And we're also in the process of writing and launching completely new docs for version 1.0 (docs/sphinx
branch).
Please feel free to drop by #remotestorage
on Freenode IRC or post on the forums anytime, if you have any questions or would like assistance with integrating rs.js 1.0 in your app/project. Any help and contributions are also greatly appreciated, of course!
Where to get help?
- See remotestorage.io for general information about remoteStorage
- Follow the remoteStorage.js Beginners Guide to get started
- Read detailed library documentation in the remoteStorage.js API docs
- Ask questions on the community forums
- Get instant support via IRC in #remotestorage on Freenode
Running a local test server
To develop remoteStorage-enabled apps, you need to have a remoteStorage-compatible storage account. We recommend php-remote-storage (PHP) or mysteryshack (Rust) for running a local test server.
You can also get an account with a hoster, or use one of the various other remoteStorage server implementations: Servers.
Which version to choose?
You can either use a stable release or the current HEAD build. Stable releases can be found in release/. Directories with a -rcX
suffix contain release candidates, which may be used for testing but aren't necessarily "stable" releases.
release/head contains a semi-current HEAD build. It is updated manually and irregularly. To build an up-to-date version of all files, run make all
in the repository root.
Which build file to use for my app?
There are a number of different builds available:
- remotestorage.js - Contains all components of remotestorage.js for running in a browser.
- remotestorage.amd.js - The same as remotestorage.js, but wrapped for use with AMD loaders such as RequireJS. When using AMD, be aware of issues #709.
- remotestorage.min.js - Minified version of remotestorage.js
- remotestorage-nocache.js - A version without any caching features included. Use this if you want your app to write directly to the remote server without caching any data in the browser's storage (localStorage or IndexedDB).
- remotestorage-nocache.amd.js, remotestorage-nocache.min.js - same as the other .amd/.min build, but based on remotestorage-nocache.js.
For more information on using the AMD build(s) and its dependencies, see the AMD documentation.
Bower
$ bower install -S remotestorage
Node.js / NPM
$ npm install remotestoragejs
See our node.js documentation for more details.
Running tests
Install development dependencies including the testing framework:
$ npm install
Run all tests:
$ npm test
Note: deliberate exceptions may look like errors, but if it says "all tests passed" under the test output all is well for that test.
Use the jaribu
executable in order to test single files, like so e.g.:
$ node_modules/.bin/jaribu test/unit/baseclient-suite.js
How to build
Make sure you have Natural Docs installed on your system (e.g. via sudo apt-get install naturaldocs
).
Display the available build tasks:
$ make
Build everything:
$ make all
Credits
Original authors: Niklas Cathor, Michiel de Jong
Sponsored by NLnet