Upgrading from <=0.40 to 0.48? See the release notes for the list of API changes and the migration guide.
We've come a long way, but this project is still in Alpha, lots of development is happening, APIs might change, beware of 🐉..
Installing ipfs
globally will give you the jsipfs
command which you can use to start a daemon running:
$ npm install -g ipfs
$ jsipfs daemon
Initializing IPFS daemon...
js-ipfs version: x.x.x
System version: x64/darwin
Node.js version: x.x.x
Swarm listening on /ip4/127.0
.... more output
You can then add a file:
$ jsipfs add ./hello-world.txt
added QmXXY5ZxbtuYj6DnfApLiGstzPN7fvSyigrRee3hDWPCaf hello-world.txt
If you do not need to run a command line daemon, use the ipfs-core
package - it has all the features of ipfs
but in a lighter package:
$ npm install ipfs-core
Then start a node in your app:
const IPFS = require('ipfs-core')
const ipfs = await IPFS.create()
const { cid } = await ipfs.add('Hello world')
console.info(cid)
// QmXXY5ZxbtuYj6DnfApLiGstzPN7fvSyigrRee3hDWPCaf
This project is broken into several modules, their purposes are:
/packages/interface-ipfs-core
Tests to ensure adherence of an implementation to the spec/packages/ipfs
The core implementation/packages/ipfs-core-utils
Helpers and utilities common to core and the HTTP RPC API client/packages/ipfs-http-client
A client for the RPC-over-HTTP API presented by both js-ipfs and go-ipfs/packages/ipfs-message-port-client
A client for the RPC-over-HTTP API presented by both js-ipfs and go-ipfs/packages/ipfs-message-port-client
A client for the RPC-over-message-port API presented by js-ipfs running in a shared worker/packages/ipfs-message-port-protocol
Code shared by the message port client & server/packages/ipfs-message-port-server
The server that receives requests from ipfs-message-port-clientList of the main packages that make up the IPFS ecosystem.
This table is generated using the module
package-table
withpackage-table --data=package-list.json
.
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。