ipfs-file-manager/IPFSManager.js

15 lines
298 B
JavaScript
Raw Permalink Normal View History

2023-06-20 22:30:55 +00:00
import { create } from 'ipfs';
export default class IPFSManager {
async initIPFS() {
this.node = await create();
console.log('IPFS node is ready');
}
async closeIPFS() {
if (this.node) {
await this.node.stop();
console.log('IPFS node connection closed');
}
}
}