node-mixer v0.0.1
node-mixer
Introduction
node-mixer is a Node.js library that allows you to run multiple files at once. It provides a simple way to require and execute multiple files in a single call.
Installation
You can install the library via npm:
npm install node-mixerUsage
Create your Node.js project and install the
node-mixerlibrary.Import the
node-mixerlibrary into your project:
const mixer = require("node-mixer");- Use the
mixerfunction to run multiple files at once:
mixer("./file1.js", "./file2.js", "./file3.js", /* add as many files as you want */);The mixer function will require each file specified in the arguments, executing their code in the order they are listed.
Example
Let's say you have three files, file1.js, file2.js, and file3.js, with the following content:
file1.js
console.log("Hello from file1.js");file2.js
console.log("Hello from file2.js");file3.js
console.log("Hello from file3.js");In your main Node.js file, you can use node-mixer to execute all these files together:
const mixer = require("node-mixer");
mixer("./file1.js", "./file2.js", "./file3.js");When you run your main file, you will see the following output:
Hello from file1.js
Hello from file2.js
Hello from file3.jsLicense
This project is licensed under the MIT License.
2 years ago