The js object and the node.script object
Choosing the Right Tool - When Should You Use node.script and/or js?
Both, the js and node.script external objects have their distinct cases. They may even be used together in a single Max patcher, in some circumstances. Here are some circumstances in which using node.script is a good choice:
- Using node.script is the better choice in situations where you want to interact with other command line utilities, the file system, or to start up and communicate with a database to manage data for your patch.
- With the node.script, object you have full access to everything that npm provides.
- You can use the remote debugger in conjunction with the node.script object, which will allow you to set breakpoints and inspect local variables.
However there are situations where the js object is the more appropriate tool:
- You should use js when you are attempting to manipulate the Max patcher directly via Patcher Scripting (such as adding and removing objects and connections dynamically).
- The js object gives you direct access to a Max-specific API that allows you interact with parts of Max like the Jitter API, the Live API and other Max specific features.
|Node For Max Documentation - Table of Contents||Node For Max Documentation - Table of Contents|