Although I admit I didn't ever think this would work, I should ask why is even needed. If you are in a browser, you cannot fetch from the user's file system, and definitely cannot from the server's file system. On the other hand, if you are doing NodeJS, you have the fs module to actually read the file system.
And in both cases, you can statically import JSON.
Although I admit I didn't ever think this would work, I should ask why is even needed. If you are in a browser, you cannot fetch from the user's file system, and definitely cannot from the server's file system. On the other hand, if you are doing NodeJS, you have the fs module to actually read the file system.
And in both cases, you can statically import JSON.
For the browser (in React, for example):
For NodeJS:
Ah thanks this is exactly what I needed.
agreed