Aloha.zone.io

Aloha's technical notes.

View on GitHub

Access file system

Well, this part is inspired by a Deno issue and my recent work, which not only for TypeScript but also JavaScript. It is not only related to Deno, but also nodejs and browsers (It is sometimes different in Chrome and Firefox).

Thus, it will contain the behavior of different ways of file access: import, dynamic import, fetch API, fs modules in browsers, nodejs and Deno.

  Deno Node Browser
Import keywork      
Import expression (dynamic)      
fetch API Deno has raw browser-like fetch API. And it is considering to have “file://” protocol Deno issue supported NodeJS does not have standard fetch, requires third party like node-fetch as polyfill Modern browsers has native support for fetch.
Requires polyfill for old browsers.
fs module Browser only supports sandbox file system API