Home>

I am trying to mount file-system, but I get the following error:

JS

import * as fs from 'fs';

I tried to connect in various ways, but unfortunately none of them worked (

There is no fs in the browser. This is a module from nodejs. What problem do you want to solve?

Alexey Ten2021-12-22 10:49:03

and if import * as fs from './fs'; or even import * as fs from './fs.js'

Макс к2021-12-22 10:56:49

I need to write an object to a json file fs.writeFileSync ('../result.json', JSON.stringify (resJson))

Michael Winogradow2021-12-22 10:57:02

@MichaelWinogradow probably needs to do this on the server in the language that you use there. What has the browser to do with it?

Alexey Ten2021-12-22 11:24:55