{"id":20943340,"url":"https://github.com/apillon/ipfs-kubo-rpc-http-client","last_synced_at":"2026-02-13T08:02:36.527Z","repository":{"id":223648623,"uuid":"755116977","full_name":"Apillon/ipfs-kubo-rpc-http-client","owner":"Apillon","description":"Simple library which wraps IPFS kubo RPC api calls into simple functions","archived":false,"fork":false,"pushed_at":"2025-03-10T13:45:17.000Z","size":426,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T18:03:02.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Apillon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-09T13:23:49.000Z","updated_at":"2025-03-10T13:45:21.000Z","dependencies_parsed_at":"2024-06-13T21:45:15.822Z","dependency_job_id":"46d5aac4-f28b-4e7d-9f0e-6b64fcbffb21","html_url":"https://github.com/Apillon/ipfs-kubo-rpc-http-client","commit_stats":null,"previous_names":["apillon/ipfs-kubo-rpc-http-client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fipfs-kubo-rpc-http-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fipfs-kubo-rpc-http-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fipfs-kubo-rpc-http-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fipfs-kubo-rpc-http-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Apillon","download_url":"https://codeload.github.com/Apillon/ipfs-kubo-rpc-http-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306601,"owners_count":21408927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T23:35:59.593Z","updated_at":"2026-02-13T08:02:31.488Z","avatar_url":"https://github.com/Apillon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ipfs-kubo-rpc-http-client\n\nSimple library which wraps some basic IPFS kubo RPC api calls into simple functions.\nCheck detail documentation for IPFS kubo RPC api [here](https://docs.ipfs.tech/reference/kubo/rpc/)\n\n## Requirements\n\n- node.js 16.17.0 or higher\n\n## Getting started\n\n### Installation\n\nLibrary can be used via Git import and is not accessible on NPM.\n\nAdd below code to `package.json` in dependency section, to install library in your project.\n\n```json\n{\n    ...\n    \"@apillon/ipfs-kubo-rpc-http-client\": \"github:Apillon/ipfs-kubo-rpc-http-client\",\n    ...\n}\n```\n\n### Initialization\n\nLibrary is working directly with IPFS kubo RPC api. Initialize client like so:\n\n```ts\nconst client = new IpfsKuboRpcHttpClient(process.env.RPC_API_URL);\n```\n\n### Upload content to IPFS\n\nTo upload data to IPFS use client.add method, which expects content as parameter. Content is of type `any`.\nAs a response, library returns instance of [`IAddResult`](./src/types/types.ts) interface with `Hash` and `Size` properties.\n\n```ts\nawait client.add({ content: \"Some test content on IPFS\" });\n```\n\n### Mutable file system (MFS)\n\nBecause files in IPFS are content-addressed and immutable, they can be complicated to edit. Mutable File System (MFS) is a tool built into IPFS that lets you treat files like you would a regular name-based filesystem.\n\n[`Files`](./src/modules/files.ts) class implements below methods, to work with MFS:\n\n- write: write content to IPFS MFS\n- ls: list all entries for path\n- stat: get properties of a object in a given path\n\nExample of writing content to MFS:\n\n```ts\nawait client.files.write({\n  content: \"This is file in MFS\",\n  path: \"/path-to-file/My MFS file.txt\",\n});\n```\n\n### Inter planetary name system (IPNS)\n\nThe InterPlanetary Name System (IPNS) is a system for creating mutable pointers to CIDs known as names or IPNS names. IPNS names can be thought of as links that can be updated over time, while retaining the verifiability of content addressing.\n\n[`Name`](./src/modules/name.ts) class implements below methods, to work with IPNS.\n\n- publish: publish CID to IPNS. In order to publish CID to IPNS, key is required. It can be generated using [`Key`](./src/modules/key.ts) class, with method `gen`.\n\n### File pinning\n\nPinning is the mechanism that allows you to tell IPFS to always keep a given object somewhere — the default being your local node.\n\n[`Pin`](./src/modules/pin.ts) class implements below methods, to manage pinned files on IPFS node:\n\n- add: pin path(file) to ipfs node\n- ls: list pinned files\n- rm: unpin given path(file) from node\n\nPin CID example:\n\n```ts\nawait client.pin.add({\n  cids: [\"bafkreiakrvel4n4dd3jirros2dbow7jvtrdtfq2pbj6i7g6qpf64krmqfe\"],\n});\n```\n\n## Error handling\n\nLibrary return instance of [`ClientError`](./src/types/client-error.ts) class if error (client or API) occurs.\n\nError has below properties:\n\n| field      | description                                                           |\n| ---------- | --------------------------------------------------------------------- |\n| status     | status code returned from request to RPC API or 400 for client errors |\n| statusText | additional info about status                                          |\n| message    | error message                                                         |\n\n## Contributing\n\nWe welcome contributions to the Apillon ipfs-kubo-rpc-http-client! If you would like to contribute, please follow these steps:\n\n1. Fork this repository.\n2. Clone your forked repository to your local machine.\n3. Install the dependencies by running npm install.\n4. Make your changes and write tests to ensure they work.\n5. Commit your changes and push them to your forked repository.\n6. Open a pull request to this repository.\n\nBefore submitting a pull request, please make sure to run the tests by running npm test. We also recommend running npm run lint to ensure your code follows our coding standards.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapillon%2Fipfs-kubo-rpc-http-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapillon%2Fipfs-kubo-rpc-http-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapillon%2Fipfs-kubo-rpc-http-client/lists"}