How to I shut down and destroy a node that I create under js-ipfs?

Hi:

I create a node like so under Node.JS:

import * as IPFS from 'ipfs-core'
const node = await IPFS.create()

I am using the node (daemon ?) intermittently. So I want to be able shut it down and destroy it when I done using it. Tell me please, how do I accomplish this task within my Node.JS code?

Thanks in advance for any help you can provide.

Hey @reselbob!

If you delete the reference to node it should be garbage collected if there are no pending promises.

GitHub - ipfs/helia: An implementation of IPFS in JavaScript is a replacement for js-ipfs and has an explicit .stop() method that you would call to ensure any pending work is canceled.