I'm not sure about what you're talking about. But here, if you didn't get the idea, is a MySQL plugin to execute JS script inside database. It's helpful for sort of task that seem to be tedious for SQL; like creating small CRC algorithm, advanced JSON manipulation/lookup...
My motivation behind is: simplify SQL queries by delegating all expensive calculation to Javascript layer.
I found the great use-case is when mixing JS with Trigger.