Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 149822

Use a javascript file to to run other javascript files (Not import functions) [duplicate]

$
0
0

I have a js file called mother.js, another called child1.js, and a last child2.js. child1.js runs a simple console.log("Hello World) and child2.js runs console.log(4+2). Let's say instead of using command line to

node child1.js
node child2.js

how can I just run a node mother.js that will run both child1.js and child2.js files in order? As in once child1.js is finished, run child2.js. Async will probably be a thing to get that working


Viewing all articles
Browse latest Browse all 149822

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>