
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

IPFS JavaScript implementation.
This repo contains the JavaScript implementation of the IPFS protocol, with feature parity to the Go implementation.
Consult the Roadmap for a complete state description of the project, or you can find in process updates in our Captain.log. A lot of components can be used currently, but it is a WIP, so beware of the Dragons đ.
This project is available through npm. To install:
$ npm install ipfs --save
Requires npm@3 and node >= 4, tested on OSX & Linux, expected to work on Windows.
To include this project programmatically:
var IPFS = require('ipfs')
var node = new IPFS()
In order to use js-ipfs as a CLI, you must install it with the global flag. Run the following (even if you have ipfs installed locally):
$ npm install ipfs --global
The CLI is available by using the command jsipfs in your terminal. This is aliased, instead of using ipfs, to make sure it does not conflict with the Go implementation.
The code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust the asset management process.
var ipfs = require('ipfs');
Loading this module in a browser (using a <script> tag) makes the Ipfs object available in the global namespace.
The last published version of the package become available for download from unpkg and thus you may use it as the source:
<!-- loading the minified version -->
<script src="https://unpkg.com/ipfs/dist/index.min.js"></script>
<!-- loading the human-readable (not minified) version -->
<script src="https://unpkg.com/ipfs/dist/index.js"></script>
The jsipfs CLI, available when js-ipfs is installed globably, follows(should, it is a WIP) the same interface defined by go-ipfs, you can always use the help command for help menus.
# Install js-ipfs globally
> npm install ipfs --global
> jsipfs --help
Commands:
bitswap A set of commands to manipulate the bitswap agent.
block Manipulate raw IPFS blocks.
bootstrap Show or edit the list of bootstrap peers.
commands List all available commands
config <key> [value] Get and set IPFS config values
daemon Start a long-running daemon process
# ...
The HTTP-API exposed by the js-ipfs daemon follows the http-api-spec. You can use any of the IPFS HTTP-API client libraries with it, such as: js-ipfs-api.
// IPFS will need a repo, it can create one for you or you can pass
// it a repo instance of the type IPFS Repo
// https://github.com/ipfs/js-ipfs-repo
const repo = <IPFS Repo instance or repo path>
// Create the IPFS node instance
const node = new IPFS(repo)
// We need to init our repo, in this case the repo was empty
// We are picking 2048 bits for the RSA key that will be our PeerId
node.init({ emptyRepo: true, bits: 2048 }, (err) => {
if (err) { throw err }
// Once the repo is initiated, we have to load it so that the IPFS
// instance has its config values. This is useful when you have
// previous created repos and you don't need to generate a new one
node.load((err) => {
if (err) { throw err }
// Last but not the least, we want our IPFS node to use its peer
// connections to fetch and serve blocks from.
node.goOnline((err) => {
if (err) { throw err }
// Here you should be good to go and call any IPFS function
})
})
We are working on making this init process better, see https://github.com/ipfs/js-ipfs/issues/556 for the discussion.
If you have built an example, please share it with the community by submitting a Pull Request to this repo!.
A complete API definition is in the works. Meanwhile, you can learn how to you use js-ipfs through the standard interface at .
Every IPFS instance also exposes the libp2p API at ipfs.libp2p. The formal interface for this API hasn't been defined by you can find documentation at its implementations:
> git clone https://github.com/ipfs/js-ipfs.git
> cd js-ipfs
> npm install
> npm test
# run just IPFS core tests
> npm run test:node:core
# run just IPFS HTTP-API tests
> npm run test:node:http
# run just IPFS CLI tests
> npm run test:node:cli
# run just IPFS Browser tests
> npm run test:browser
Conforming to linting rules is a prerequisite to commit to js-ipfs.
> npm run lint
> npm run build

> tree src -L 2
src # Main source code folder
âââ cli # Implementation of the IPFS CLI
â  âââ ...
âââ http-api # The HTTP-API implementation of IPFS as defined by http-api-spec
âââ core # IPFS implementation, the core (what gets loaded in browser)
â  âââ components # Each of IPFS subcomponent
â  âââ ...
âââ ...

What does this image explain?
ipfs-repo which picks fs or indexeddb as its storage drivers, depending if it is running in Node.js or in the Browser.bitswap, uses the Block Service which in turn uses the Repo, offering a get and put of blocks to the IPFS implementation.ipfs-unixfs-engine to import and export files to and from IPFS.| Package | Version | Deps | DevDeps |
|---|---|---|---|
| API Specs | |||
interface-ipfs-core | |||
http-api-spec | |||
cli spec | |||
| Repo | |||
ipfs-repo | |||
| DAG | |||
ipld-resolver | |||
ipld-dag-pb | |||
ipld-dag-cbor | |||
| Files | |||
ipfs-unixfs-engine | |||
| Exchange | |||
ipfs-block-service | |||
| Swarm/libp2p | |||
js-libp2p | |||
libp2p-ipfs-nodejs | |||
libp2p-ipfs-browser | |||
| Data Types | |||
ipfs-block | |||
ipfs-unixfs | |||
peer-id | |||
peer-info | |||
multiaddr | |||
multihashes | |||
| Generics/Utils | |||
ipfs-api | |||
ipfs-multipart | |||
multihashing | |||
mafmt |
IPFS implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out:
MIT.
FAQs
JavaScript implementation of the IPFS specification
The npm package ipfs receives a total of 1,175 weekly downloads. As such, ipfs popularity was classified as popular.
We found that ipfs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.