PM2 supporting all three document types being the basis for program descriptions and modification

PM2 supporting all three document types being the basis for program descriptions and modification

JSON vs. JavaScript vs. YAML

PM2 helps all three data sort while the foundation towards program descriptions and personalization. Select your preferred an individual and match up with they, there are no primary advantages of choosing for example and other.

Wea€™re admirers of JSON and will show off your all illustrations in JSON style. Just follow the snippets to JS or YAML.

Configure A Number Of Purposes in one single JSON Data

Within an earlier printed tutorial, youra€™ve previously watched PM2a€™s ability to deal with state-of-the-art product designs utilizing a JSON data. Youa€™ve lots of options available to personalize the habits of the solutions was able by PM2.

Within the JSON document, PM2 employs the applications essential as foundation for a directory of classified applications. Individual each program into an object and provide the recognized options with particular prices. The subsequent sample defines three services: futurestudio-homepage , futurestudio-worker and futurestudio-api . All three systems get their own entry point (JS file) and that’s referenced because worth for software .


PM2 calls for you to give a minimum of the expression and software elements to properly reference and commence the outlined program. The worthiness for term are going to be used by PM2 as a reference within the processes and is distinctive.

To get started with the described programs in the pm2-apps.json , make use of the pm2 order line energy and mention the JSON data. PM2 will automatically detect each tool and commence these people right-away.

The snippet above demonstrates the entire process of starting a number of solutions through the pm2-apps.json document (above). If perhaps a software (documented by name) wasna€™t previously running, PM2 begins they. As soon as creating schedule for all steps complete, youa€™ll start to see the usual overview of steps maintained by PM2.

We cana€™t personalize the transaction where functions get going. Continue reading to know tips on how to act upon an individual product in processes document.


Any motion utilized (beginning, resume, reload, end) right to the JSON configuration document are died to any or all procedures within that file. Properly, in the event you accomplish the pm2 resume command directly on your own JSON configuration file, all described tasks within that data put restarted promptly.

To act on one application within a JSON data, you need to take a look at soon after point.

Work Simply a Single Program Within a Process Document

In situations where you want to act on your JSON settings but simply should list a solitary software, you certainly can do that with the addition of the –only debate into the pm2 management. For instance, if you ought to begin the employee process best, exercise in this way:

Once begin, simply control active PM2 procedures typical means.


Static configurations in JS, JSON or YAML style tend to be a hassle free technique to create sophisticated customizations towards your programs which get maintained with PM2. We dona€™t have to recall the person commands that youa€™d usually use by using the demand line energy.

This informative guide displayed you how to establish well over an individual tool within a JSON document and you can pertain that to JS and YAML nicely. Possessing many tool descriptions in one single data may benefit we in numerous scenarios. Watch steps that are applied with reference to the JSON file, because theya€™re performed per identified software. Should you wish to list a single software use –only point.

Have you got farther along query on PM2 or Node.js in general? Merely permit uns determine on Youtube @futurestud_io or get out of a comment below.

Allow rock & enjoy programming!

Come Notified on Brand-new Future Work Articles and Platform News

Get your weekly press notice about latest and in demand potential facility content and current program innovations


Add Your Comments

Your email address will not be published. Required fields are marked *