
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ipfs-block
Advanced tools
IPFS implementation of the Block data structure in JavaScript.
Block - A block is a blob of binary data.
const Block = require('ipfs-block')
// create a block
const block = new Block('hello world')
console.log(block.data)
console.log(block.key)
> npm i ipfs-block
const Block = require('ipfs-block')
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 asset management process.
var Block = require('ipfs-block')
<script>
TagLoading this module through a script tag will make the IpfsBlock
obj available in
the global namespace.
<script src="https://npmcdn.com/ipfs-block/dist/index.min.js"></script>
<!-- OR -->
<script src="https://npmcdn.com/ipfs-block/dist/index.js"></script>
const Block = require('ipfs-block')
new Block(data, [type])
Creates a new block with raw data data
. type
can be either 'protobuf'
or 'ipld'
block.data
The raw data of the block. Its format matches whatever was provided in its constructor.
block.key
The multihash of the block's data, as a buffer.
block.extension
The extension on how to store the blog, depends on the type:
'protobuf'
: 'data'
'ipld'
: 'ipld'
MIT
FAQs
JavaScript Implementation of IPFS Block
We found that ipfs-block demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.