Storing data through IPFS forever

Hello everyone,

I want to store some data(file,json,text,etc.) through IPFS. For example, I used the following javascript code for storing JSON:

const IPFS = require(‘ipfs-mini’);
const ipfs = new IPFS({ host: ‘’, port: 5001, protocol: ‘https’ });

ipfs.addJSON({ somevalue: 2, name: ‘Nick’ }, (err, result) => {
if (err){

Now I want to know how long this data will remain in the net. That is, I need a solution that will last for 20+ years. Does this way will store data permanently? If not, do you have a clear example( especially in javascript) to show me a guaranteed way to store data using IPFS forever?

Thanks in advance,