Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Latest commit

 

History

History

ipfs-core-types

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

⛔️ DEPRECATED: js-IPFS has been superseded by Helia

📚 Learn more about this deprecation or how to migrate

⚠️ If you continue using this repo, please note that security fixes will not be provided

ipfs-core-types

ipfs.tech Discuss codecov CI

IPFS interface definitions used by implementations for API compatibility.

Table of contents

Install

$ npm i ipfs-core-types

Background

The primary goal of this module is to define and ensure that IPFS core implementations and their respective client libraries implement the same interface, so that developers can quickly change between a local and a remote node without having to change their applications.

It offers a set of typescript interface definitions that define the IPFS core API. Once your implementation implements those APIs you can use the tests found in the interface-ipfs-core module to validate your implementation.

$ npm install ipfs-core-types

Usage

Install ipfs-core-types as one of the dependencies of your project and use it to ensure your implementations API compatibility:

/**
 * @implements {import('ipfs-core-types').IPFS}
 */
class MyImpl {
  // your implementation goes here
}

In Typescript

import type { IPFS } from 'ipfs-core-types'
class MyImpl implements IPFS {
  // your implementation goes here
}

Validation

In order to validate API compatibility you can run typescript over your implementation which will point out all the API compatibilities if there are some.

License

Licensed under either of

Contribute

Contributions welcome! Please check out the issues.

Also see our contributing document for more information on how we work, and about contributing in general.

Please be aware that all interactions related to this repo are subject to the IPFS Code of Conduct.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.