Live API in Max for Node?

Jay Walker's icon

I'm trying to use Node to read and write to a JSON file, but am not clear.. is Live API accessible in Max for Node? I get a LiveAPI not defined error even after making sure I'm opening Max from Live. I'd like to have ableton functions in my code but maybe I'll have to try this another way?

fastfourier's icon

I remember reading somewhere that you can't access the Live API directly from the node.script object.
You could use a separate js object in the patcher to handle all the Live API stuff, and pass messages back and forth between it and the node.script.

Jay Walker's icon

Thank you FastFourier! I was thinking the async capabilities of node might be nice with live api, but your comment helped me focus on optimizing JS instead of adding more stuff. You're totally spot on with bouncing things between node and JS!