include.modern
All Platform use to like importScripts function
usage
make a module
ex1
thisconstructorname === "Object" ? moduleexports = myModule: Object;
ex2: Using is.modern
isserver ? moduleexports = myModule: Object;
ex3: Using is.modern
isserver && moduleexports = myModule isserver || Object;
including
Node.js
npm install include.modern
let include = ;//You can do it like a importScripts /*The means of same... let http = require("http"), express = require("express"), myCtrls = require(./myCtrls.js);*/ ; //define global ; /*The means of same...let ctrls = { route: require("./route.js"), index: require("./controllers/index.js"), foo: require("./controllers/foo.js"), bar: require("./controllers/bar.js")}*/ const path = "./controllers/";include;let ctrls = ;
Worker
Download this repository.
let include = ;//You can do it like a importScripts ;
Browser
insert first this tag
and my.js file can use
/*You can do it like a importScripts && return Promise and Promise.then === Promise.deferAs You like to use it!*/defer { //scripting here};
Happy Hacking!!!