Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18 lines (11 sloc)
345 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const IPFS = require('ipfs') | |
| async function main () { | |
| const node = await IPFS.create({silent: true}) | |
| const filesAdded = await node.add({ | |
| path: 'hello.txt', | |
| content: Buffer.from('Hello World 101') | |
| }) | |
| const fileBuffer = await node.cat(filesAdded[0].hash) | |
| console.log('Added file contents:', fileBuffer.toString()) | |
| } | |
| main() |