Unfortunately you can't require node modules directly in code.js, but you can however hook into the Animator component life-cycle events, or even fire your own event from the component and hook into it from your codebase.

TL;DR: the solution is to implement the logic that requires external modules in your host codebase and communicate back and forth with the component via its API.

Did this answer your question?