deno-musings/test_changer.mjs
2024-10-11 15:54:15 -04:00

20 lines
533 B
JavaScript

export let changing = "hello!";
////////////////////////////////////////////
let ReImported = {};
const thisURL = new URL(import.meta.url)
const thisFile = thisURL.pathname;
if(!thisURL.search)
{
setInterval(()=>{
import(thisFile+"?"+Math.random()).then(module=>{
ReImported = module;
for(let key in module)
{
const statement = `${key}=ReImported.${key}`
eval(statement);
console.log(statement);
}
})
}, 3000);
}