- Notifications
You must be signed in to change notification settings - Fork0
zboxfs/zbox-nodejs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
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.
npm i @zbox/nodejs
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();})();
Check the API documentation athttps://docs.zbox.io/api/.
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.
Usezboxfs/nodejs docker image to build the shared library.
docker run --rm -v$PWD:/root/zbox zboxfs/nodejs npm run buildUse below command to build the shared library.
npm run build
windows-build-tools
npm install --global --production windows-build-tools
Use below command to build the shared library.
npm run build
This package is licensed under the Apache 2.0 License - see theLICENSEfile for details.
About
Node.js binding for ZboxFS
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.