
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
ipfs-repo
Advanced tools
Implementation of the IPFS repo spec (https://github.com/ipfs/specs/tree/master/repo) in JavaScript
Constructor, accepts a path and options:
var Repo = require('js-ipfs-repo')
var repo = new Repo('/Users/someone/.ipfs', {adaptor: 'fs'})
Options:
adaptor
: String with the adaptor. Defaults to fs
Read/Write the version number of that repository.
repo.version.read(function (err, num) {
console.log(err, num) // => 2
})
repo.version.write(3, function (err) {
console.log(err)
})
Read/Write the JSON configuration for that repository.
repo.api.read(function (err, multiaddr) {
console.log(err, multiaddr)
})
repo.api.write('/ip4/127.0.0.1/tcp/5001', function (err) {
console.log(err)
})
Read/Write the JSON configuration for that repository.
repo.config.read(function (err, json) {
console.log(err, json)
})
repo.config.write({foo: 'bar'}, function (err) {
console.log(err)
})
Store data on the block store.
repo.blocks.read('12200007d4e3a319cd8c7c9979280e150fc5dbaae1ce54e790f84ae5fd3c3c1a0475', function (buff, err) {
console.log(err)
})
repo.blocks.write(buff, function (buff, err) {
console.log(buff.toString('utf-8'), err)
})
Read/Write the repo.lock
file.
repo.repo.read(function (err, content) {
console.log(err, content)
})
repo.repo.write('foo', function (err) {
console.log(err)
})
By default it will use the fs-repo
adaptor. Eventually we can write other adaptors
and make those available on configuration.
The default adaptor. Uses the repo.lock
file to ensure there are no simultaneous reads
nor writes. Uses the fs-blob-store
.
Ideal for testing purposes. Uses the abstract-blob-store
.
Help us make more tests! Also, enabling them to be run in Node.js and the Browser.
FAQs
IPFS Repo implementation
The npm package ipfs-repo receives a total of 2,690 weekly downloads. As such, ipfs-repo popularity was classified as popular.
We found that ipfs-repo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.