@cloudos/gitee-fs
v1.0.21
Published
* typescript * @clodos/gitee-api
Downloads
40
Readme
Built With
- typescript
- @clodos/gitee-api
Getting Started
- Install this library
npm i @cloudos/gitee-fs
oryarn add @cloudos/gitee-fs
. - Using the fs api in your code;
import {GiteeFS} from '@cloudos/gitee-fs';
const setup=async()=>{
await GiteeFS.init({accessToken: "you gitee access token"})
const {fs,fsPromises}=await GiteeFS.import();
(window as any).fs=fs;
(window as any).fsPromises=fsPromises;
// now you can use with "fs.readdir(path,console.log)" etc.
}
setup();
Once the GiteeFs is initialized, metadata like owner
and repo
and accessToken
will be stored in the indexedDB. If you need to reconfigure the metadata, using:
// A prompt box will pup up for inputing metadata.
GiteeFS.config();
Usage
Check the apis defined in the code (lib/index.d.ts).
License
MIT License.