deno-musings/test_changer.mjs

20 lines
533 B
JavaScript
Raw Permalink Normal View History

2024-10-11 15:54:15 -04:00
export let changing = "hello!";
2024-10-10 10:00:12 -04:00
2024-10-11 13:04:47 -04:00
////////////////////////////////////////////
let ReImported = {};
2024-10-10 10:00:12 -04:00
const thisURL = new URL(import.meta.url)
const thisFile = thisURL.pathname;
if(!thisURL.search)
{
setInterval(()=>{
import(thisFile+"?"+Math.random()).then(module=>{
2024-10-11 13:04:47 -04:00
ReImported = module;
for(let key in module)
{
const statement = `${key}=ReImported.${key}`
eval(statement);
console.log(statement);
}
2024-10-10 10:00:12 -04:00
})
}, 3000);
}