@@ -29,6 +29,16 @@ export const promises = {
2929 rm : async ( ) => { } ,
3030} ;
3131
32+ // os polyfills
33+ export const type = ( ) => 'Browser' ;
34+ export const platform = ( ) => 'browser' ;
35+ export const release = ( ) => '1.0.0' ;
36+ export const tmpdir = ( ) => '/tmp' ;
37+ export const homedir = ( ) => '/' ;
38+ export const endianness = ( ) => 'LE' ;
39+ export const arch = ( ) => 'javascript' ;
40+ export const EOL = '\n' ;
41+
3242export const readFileSync = ( ) => '' ;
3343export const writeFileSync = ( ) => { } ;
3444export const statSync = ( ) => ( { isDirectory : ( ) => false , isFile : ( ) => false , isSymbolicLink : ( ) => false } ) ;
@@ -45,20 +55,25 @@ export const relative = () => '';
4555export const posix = { } ;
4656export const win32 = { } ;
4757
58+ // fs/promises and other missing exports
59+ export const open = async ( ) => ( { close : async ( ) => { } } ) ;
60+ export const watchFile = ( ) => { } ;
61+ export const unwatchFile = ( ) => { } ;
62+
4863export const fileURLToPath = ( ) => '' ;
4964export const pathToFileURL = ( ) => '' ;
5065
5166export const readdir = ( ) => { } ;
5267export const readdirSync = ( ) => [ ] ;
5368export const readlink = ( ) => { } ;
5469export const readlinkSync = ( ) => '' ;
55- export const realpath = ( ) => { } ;
70+ export const realpath = async ( ) => '' ;
5671export const realpathSync = ( ) => '' ;
5772realpathSync . native = ( ) => '' ;
5873
5974export const constants = { } ;
60- export const lstat = ( ) => { } ;
61- export const stat = ( ) => { } ;
75+ export const lstat = async ( ) => ( { isDirectory : ( ) => false , isFile : ( ) => false , isSymbolicLink : ( ) => false } ) ;
76+ export const stat = async ( ) => ( { isDirectory : ( ) => false , isFile : ( ) => false , isSymbolicLink : ( ) => false } ) ;
6277export const access = ( ) => { } ;
6378export const accessSync = ( ) => { } ;
6479export const mkdir = ( ) => { } ;
0 commit comments