ipfs-core
![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-ipfs/test.yml?branch=master&style=flat-square)
JavaScript implementation of the IPFS specification
Table of contents
Install
$ npm i ipfs-core
Browser <script>
tag
Loading this module through a script tag will make it's exports available as IpfsCore
in the global namespace.
<script src="https://unpkg.com/ipfs-core/dist/index.min.js"></script>
The JavaScript implementation of the IPFS protocol
ipfs-core
ipfs-core
is the implementation of the IPFS Core API written in JavaScript without depending on other languages/implementations. It contains all you need to integrate IPFS into your application.
If you want to run IPFS as a standalone daemon process, see the ipfs module.
Getting Started
The ipfs-core
package contains all the features of ipfs
but in a lighter package without the CLI or HTTP servers:
$ npm install ipfs-core
Then start a node in your app:
import * as IPFS from 'ipfs-core'
const ipfs = await IPFS.create()
const { cid } = await ipfs.add('Hello world')
console.info(cid)
Next Steps
Browser CDN
You can load IPFS right in your browser by adding the following to your page using the super fast jsdelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/ipfs-core/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ipfs-core/dist/index.min.js"></script>
Inserting one of the above lines will make an IpfsCore
object available in the global namespace:
<script>
async function main () {
const node = await window.IpfsCore.create()
}
main()
</script>
Browser bundle
Learn how to bundle IPFS into your application with webpack, parceljs and browserify in the examples.
Want to hack on IPFS?
![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)
The IPFS implementation in JavaScript needs your help! There are a few things you can do right now to help out:
Read the Code of Conduct and JavaScript Contributing Guidelines.
- Check out existing issues The issue list has many that are marked as 'help wanted' or 'difficulty:easy' which make great starting points for development, many of which can be tackled with no prior IPFS knowledge
- Perform code reviews More eyes will help
a. speed the project along
b. ensure quality, and
c. reduce possible future bugs.
- Add tests. There can never be enough tests.
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.
![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)