Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Browser JavaScript binding for ZboxFS

License

NotificationsYou must be signed in to change notification settings

zboxfs/zbox-browser

Repository files navigation

This package is browser javascript binding forZboxFS.

ZboxFS is a zero-details, privacy-focused in-app file system. Its goal isto help application store files securely, privately and reliably. Check moredetails aboutZboxFS.

Get Started

Installation

  1. Downloadzbox-browser-0.6.0.tar.gz fromlatest release
  2. Extract it to your website'sstatic orpublic folder
  3. Import it using<script> tag
<scriptsrc="zbox-browser-0.6.0/index.js"></script>

Note: because ofsame-origin policy restriction, use this package as across-origin script won't work.

Hello World Example

Visithttps://zbox.io/try to create a test repo. Copy its URI and replace[your_repo_uri] in below.

<scriptsrc="zbox-browser-0.6.0/index.js"></script><script>(async()=>{// create a Zbox instanceconstzbox=newZbox();// initialise environment, called once before using Zboxawaitzbox.initEnv({log:{level:'debug'}});// open the repovarrepo=awaitzbox.openRepo({uri:'[your_repo_uri]',pwd:'secret password',opts:{create:true}});// create a fileletfile=awaitrepo.createFile('/hello_world.txt');// write content to fileawaitfile.writeOnce('Hello, World!');// seek to the beginning of fileawaitfile.seek({from:Zbox.SeekFrom.Start,offset:0});// read all content as stringconststr=awaitfile.readAllString()console.log(str);// close file, repo and exit Zboxawaitfile.close();awaitrepo.close();awaitzbox.exit();})();</script>

API Documentation

Check the API documentation athttps://docs.zbox.io/api/.

How to Build

This is for advanced users who want to build this package by themselves.

You needDocker to build this package.

Build Package

./scripts/build.sh

After running this command, package files will be created indist folderand ready to be released to GitHub.

How to Release

To release this package to GitHub, you need aPersonal access tokens.

export ZBOX_BROWSER_GITHUB_TOKEN=[your Personal access token]node ./scripts/release.js

After running this command, release tarball will be created inrelease folderand uploaded to GitHub. A draft release will be created as well if it is notthere yet.

Latest code will also be committed, tagged and pushed to GitHub.

License

This package is licensed under the Apache 2.0 License - see theLICENSEfile for details.

About

Browser JavaScript binding for ZboxFS

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp