Skip to content

Instantly share code, notes, and snippets.

View fetch.js
function getFile(path) {
const file = Deno.openSync(path, {read: true})
const buf = Deno.readAllSync(file)
Deno.close(file.rid)
return new TextDecoder().decode(buf)
}
const user = Deno.env.get('USER')
const host = getFile('/etc/hostname').trimRight()
const kernel = getFile('/proc/version').split(' ')[2]
You can’t perform that action at this time.