@hugoalh/matsdeprecated

A module/library to make function/module file from asynchronous to synchronous.

Usage no npm install needed!

<script type="module">
  import hugoalhMats from 'https://cdn.skypack.dev/@hugoalh/mats';
</script>

README

[NodeJS] MATS (Make Asynchronous To Synchronous)

hugoalh-studio/NodeJS.MATS

GitHub Contributors License GitHub Language Count GitHub Top Langauge GitHub Repo Size GitHub Code Size GitHub Watchers GitHub Stars GitHub Forks CodeFactor Grade LGTM Alerts LGTM Grade

Release Issue Pull Request
Latest: ()
Pre: ()
NPM
Open:
Closed:
Open:
Closed:

📜 Description

A module/library to make function/module file from asynchronous to synchronous, via child_process.execFileSync.

Click here to view the official documentation online.

âš  Important

  • Do not use this in the server! This will completely unable to scale, and cause the server freeze/hang.
  • Do not use this for a synchronous function/module file! This can cause performance issue.

📄 Documentation (Excerpt)

Getting Started

NodeJS (v10+) & NPM (v6+):

> npm install @hugoalh/mats

API

execute(modulePath, ...inputs?)

Example

const mats = require("@hugoalh/mats");

mats.execute(
  require.resolve("./settimeout.js"),
  JSON.stringify({
    time: 5000
  })
);