Does wix allow file system module?

I tried importing fs without success, and then went to the npm packages, searched fs and this comes up, with a note saying its not compatible.
"
fs
v0.0.1-security ISC
This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we’ll probably give it to you if you want it.
"

I would like to read and write to a file some json configs (oauth2.0 tokens). If this is not allowed is the only other option saving the json to wix database?

Anybody?

Wix sites don’t support fs (file system).

I also wanted to use a json config file for a project, and I used a database collection instead.

Feel free to visit the Wishlist Page where you can request new features.

I guess that is what I will have to do.

Thank you Yisrael.

Hi folks!

For anyone stumbling on this post from google, some clarity regarding what we can currently do with JSON files:

  1. You can read and import JSON files at will in the backend, so long as you import using WIX’s version of directory paths. Example: “let foo = require(‘backend/bar.json’)”
  2. We cannot write back to that file, it’s a read only. When you need to write, save it to a database.
  3. Any oauth tokens can live in memory against such a “foo” variable once set, but of course reset with the site. This reset isn’t including the additional problematic issues that come with versioning and auto scaling. Don’t count on your site having a single instance, especially in an SaaS environment.
  4. The most stable method for storing many long lived client oauth tokens is to store encrypted at the database level. Outside of the obvious fs restriction, I would argue against writing them to a file as a general practice anyways. If we were hosting our own server and knew there was only one instance - okay maybe. With WIX, even if we could access fs programmatically, each file change would create new site versioning. I don’t think most of us would want that.