top | item 23172944

(no title)

snek | 5 years ago

there are no "async" or "sync" imports in js. there are static and dynamic imports. An implementation is free to spend as much time as it likes between parsing a file to get the static imports and actually running the file doing whatever it likes, including fetching urls, reading the file system, etc. dynamic imports return a promise but the implementation is free to resolve that promise immediately (e.g. `return Promise.resolve(loadSync(module))`)

discuss

order

ravenstine|5 years ago

I suppose that makes sense since loading a module from a file on a disk isn't all that different from loading a file over a TCP connection.