Published
Edited
Aug 8, 2019
13 stars
Insert cell
Insert cell
{
const img = new Image();
const src = URL.createObjectURL(
new Blob(
[
await node.cat(
"/ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg"
)
],
{ type: "application/octet-binary" }
)
);
img.src = src;
img.style = "height:400px;width:640px;";
invalidation.then(() => URL.revokeObjectURL(src));
return img;
}
Insert cell
Insert cell
node = {
const IPFS = await require("ipfs@0.37.0/dist/index.js");
return new IPFS().ready;
}
Insert cell
html`<pre>${(await node.cat(
"/ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme"
)).toString()}</pre>`
Insert cell
Insert cell
Insert cell
added = node.add([new Buffer("Hello, IPFS")])
Insert cell
html`<pre>${(await node.cat(added[0].hash)).toString()}</pre>`
Insert cell
Buffer = (await require("https://bundle.run/buffer")).Buffer
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more