JavaScript implementation of the IPFS specification
$ npm install ipfs-core
The IPFS Core API
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.
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)
// QmXXY5ZxbtuYj6DnfApLiGstzPN7fvSyigrRee3hDWPCaf
You can load IPFS right in your browser by adding the following to your page using the super fast jsdelivr CDN:
<!-- loading the minified version using jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/ipfs-core/dist/index.min.js"></script>
<!-- loading the human-readable (not minified) version jsDelivr -->
<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()
// Ready to use!
// See https://github.com/ipfs/js-ipfs#core-api
}
main()
</script>
Learn how to bundle IPFS into your application with webpack, parceljs and browserify in the examples.
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.
Find out about chat channels, the IPFS newsletter, the IPFS blog, and more in the IPFS community space.
© 2010 - cnpmjs.org x YWFE | Home | YWFE