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

Node.js binding for ZboxFS

License

NotificationsYou must be signed in to change notification settings

zboxfs/zbox-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This pacakge is Node.js 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

npm i @zbox/nodejs

Hello World Example

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

constassert=require('assert').strict;constZbox=require('@zbox/nodejs');(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 filevarfile=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()assert.strictEqual(str,'Hello, World!');// close file and repoawaitfile.close();awaitrepo.close();})();

API Documentation

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

How to Build

This is for advanced user. If simply use this package, you don't need to buildby yourself asnpm install will automatically download the pre-built binary.

This library needs to be compiled to platform-specific binary, it currentlysupports 64-bit Linux, macOS and Windows.

After running the building command, it will generateindex.node sharedlibrary innative folder. This library must be used with javascript wrappers,which can be found inlib directory.

Linux

Prerequisites

Docker

Build

Usezboxfs/nodejs docker image to build the shared library.

docker run --rm -v$PWD:/root/zbox zboxfs/nodejs npm run build

macOS

Prerequisites

Rust

Build

Use below command to build the shared library.

npm run build

Windows

Prerequisites

  • Rust

  • windows-build-tools

    npm install --global --production windows-build-tools

Build

Use below command to build the shared library.

npm run build

License

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

About

Node.js binding for ZboxFS

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp