# js-ipfs **Repository Path**: aibot8/js-ipfs ## Basic Information - **Project Name**: js-ipfs - **Description**: 2020.03.15最新版mfs实例代码 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-03-15 - **Last Updated**: 2024-06-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

IPFS in JavaScript logo

The JavaScript implementation of the IPFS protocol.


> **Upgrading from <=0.40 to 0.41?** See the [release notes](https://github.com/ipfs/js-ipfs/issues/2656) for the list of API changes and the [migration guide](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26). ### Project status - `Alpha` We've come a long way, but this project is still in Alpha, lots of development is happening, API might change, beware of the Dragons 🐉. **Want to get started?** Check our [examples folder](/examples) to learn how to spawn an IPFS node in Node.js and in the Browser. 🚨 **Please read this** 🚨 The [DHT](https://en.wikipedia.org/wiki/Distributed_hash_table), a fundamental piece for automatic content and peer discovery is not yet complete. There are multiple applications that can be built without this service but nevertheless it is fundamental to getting that magic IPFS experience. The current status is that implementation is done and merged and we're working on performance issues. Expect the DHT to be available in a release very soon. [**`Weekly Core Implementations Call`**](https://github.com/ipfs/team-mgmt/issues/992) ## Tech Lead [David Dias](https://github.com/daviddias) ## Lead Maintainer [Alan Shaw](https://github.com/alanshaw) ## Table of Contents - [Structure](#structure) - [Development](#development) - [Clone and install dependencies](#clone-and-install-dependencies) - [Run tests](#run-tests) - [Lint](#lint) - [Build a dist version](#build-a-dist-version) - [Publishing new versions](#publishing-new-versions) - [Using prerelease versions](#using-prerelease-versions) - [Contribute](#contribute) - [Want to hack on IPFS?](#want-to-hack-on-ipfs) - [License](#license) ## Structure This project is broken into several modules, their purposes are: * [`/packages/ipfs`](./packages/ipfs) The core implementation * [`/packages/ipfs-http-client`](./packages/ipfs-http-client) A client for the RPC-over-HTTP API presented by both js-ipfs and go-ipfs * [`/packages/interface-ipfs-core`](./packages/interface-ipfs-core) Tests to ensure adherance of an implementation to the spec * [`/packages/ipfs-utils`](./packages/ipfs-utils) Helpers and utilities common to core and the HTTP RPC API client * [`/packages/ipfs-mfs`](./packages/ipfs-mfs) The mfs implementation * [`/packages/ipfs-multipart`](./packages/ipfs-multipart) A module that handles adding files via multipart HTTP requests for core and the mfs ## Development ### Clone and install dependencies ```sh > git clone https://github.com/ipfs/js-ipfs.git > cd js-ipfs > npm install ``` This will install [lerna](https://www.npmjs.com/package/lerna) and bootstrap the various packages, deduping and hoisting dependencies into the root folder. If later you add new dependencies to submodules or just wish to remove all the `node_modules`/`dist` folders and start again, run `npm run reset && npm install` from the root. See the scripts section of the root [`package.json`](./package.json) for more commands. ### Run tests ```sh # run all the unit tests > npm test # run just IPFS tests in Node.js > npm run test:node # run just IPFS tests in a browser > npm run test:browser # run just IPFS tests in a webworker > npm run test:webworker ``` More granular test suites can be run from each submodule. Please see the `package.json` in each submodule for available commands. ### Lint Please run the linter before submitting a PR, the build will not pass if it fails: ```sh > npm run lint ``` ### Build a dist version ```sh > npm run build ``` ### Publishing new versions 1. Ensure you have a `GH_TOKEN` env var containing a GitHub [Personal Access Token](https://github.com/settings/tokens) with `public_repo` permissions 2. From the root of this repo run `npm run release` and follow the on screen prompts. It will use [conventional commits](https://www.conventionalcommits.org) to work out the new package version ### Using prerelease versions Any changed packages from each successful build of master are published to npm as canary builds under the npm tag `next`. ## Contribute IPFS implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out: - Go through the modules below and **check out existing issues**. This would be especially useful for modules in active development. Some knowledge of IPFS may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically. - **Perform code reviews**. More eyes will help (a) speed the project along, (b) ensure quality, and (c) reduce possible future bugs. - Take a look at go-ipfs and some of the planning repositories or issues: for instance, the [libp2p spec](https://github.com/ipfs/specs/pull/19). Contributions here that would be most helpful are **top-level comments** about how it should look based on our understanding. Again, the more eyes the better. - **Add tests**. There can never be enough tests. ### Want to hack on IPFS? [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) Check out [ipfs/community/CONTRIBUTING_JS.md](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for details on coding standards, commit messages and other project conventions ## License [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fipfs%2Fjs-ipfs.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fipfs%2Fjs-ipfs?ref=badge_large)