@cloudos/gitee-fs
TypeScript icon, indicating that this package has built-in type declarations

1.0.21 • Public • Published

@cloudos/gitee-fs

Node file system API in browser backed by Gitee repositories.

Built With

  • typescript
  • @clodos/gitee-api

Getting Started

  1. Install this library npm i @cloudos/gitee-fs or yarn add @cloudos/gitee-fs.
  2. 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.

(back to top)

Readme

Keywords

Package Sidebar

Install

npm i @cloudos/gitee-fs

Weekly Downloads

1

Version

1.0.21

License

MIT

Unpacked Size

33.6 kB

Total Files

10

Last publish

Collaborators

  • peiiii