Do you want to create a web application that, for example, allows the user to select a file from the file system and view it's contents? With Drayman it would be a single script:
import { promises as fs } from "fs";
export const component: DraymanComponent = async ({ forceUpdate }) => {
const files = (await fs.readdir("./")).filter((x) => x.includes("."));
let selectedFile;
return async () => {
return (
<>
<p>Select a file to view it directly from file system</p>
<select
onchange={async ({ value }) => {
selectedFile = value;
await forceUpdate();
}}
>
{files.map((fileName) => (
<option value={fileName}>{fileName}</option>
))}
</select>
<br />
{selectedFile && <pre>{await fs.readFile(selectedFile, "utf-8")}</pre>}
</>
);
};
};