How to remove module not found error?

I’m trying to use fs module to store some data in json file. I used,

const fs=require('fs');

But i am getting following error,

Module not found: Error: Can't resolve 'fs' in '/home/ubuntu/Projects/hybrid/todo/src/js'

How can i remove this error?

fs is a Node.js only thing. If you do a client app, you can’t use it

Is there any way to edit and save json in a file on client side?

If it is a web app then no. In Cordova app you can try to use this plugin GitHub - apache/cordova-plugin-file: Apache Cordova Plugin file

But if it is a single JSON and it is not huge, I would just store the data in localStorage or on remote database

I will try cordova-plugin-file. I’m creating a hybrid todo app. I can’t decide whether to use sqlite database or store all data in json file. I will try both and see which one is fast.