1.0.5 • Published 9 months ago

@zkdb/kubo v1.0.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

A simple IPFS RPC Client

This built for Kubo node

Installation

npm i @zkdb/kubo

Usage

import { KuboClient } from "@zkdb/kubo";

(async () => {
  const client = new KuboClient();

  console.log(await client.filesLs());

  console.log(await client.filesRm({ arg: "/hello.txt" }));

  console.log(await client.filesStat({ arg: "/" }));

  console.log(
    await client.filesWrite(
      "/hello.txt",
      new TextEncoder().encode("Hello motherfukers! Robot here!")
    )
  );

  console.log(
    await client.filesMkdir({ arg: "/test/sub1/sub2", parents: true })
  );

  console.log(await client.existFile("/test"));
  console.log(await client.existDir("/test"));
  console.log(await client.exist("/test"));
  console.log(await client.existFile("/hello.txt"));
  console.log(await client.existDir("/hello.txt"));

  console.log(await client.filesRead({ arg: "/hello.txt" }));
  const result = await client.filesStat({ arg: "/" });

  console.log(await client.pinAdd({ arg: `/ipfs/${result.Hash}/test` }));

  console.log(
    await client.pinAdd({
      arg: `/ipfs/${result.Hash}/test/hello.txt`,
    })
  );

  console.log(await client.namePublish());

  console.log(
    await client.nameResolve(
      "k51qzi5uqu5did8im9w5dodv91gunxjqyvjlicyk2mrmsqes3n5m42pqp16t8e"
    )
  );

  console.log(await client.keyList());
})();

License

This project is licensed under the Apache-2.0.

built with ❤️

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

10 months ago

1.0.0

10 months ago