In my resource/assets/js I have tests.js ,I use gulp to build all files from js including this one ,in this file I have
var cmd = require('node-cmd');
console.log('You are returning: ',data)
assets folder into (1
app.js file in) your public folder.
Note however, that both NodeJS and php are server side technologies and you should really know what you're doing to make them work together. Pushing NodeJS libraries in your public folder to use client side is NOT what NodeJS is made for and you should probably not use it that way.