Thanks I was more referring to Node, do I need to include anything like the Node.exe file, or will typing a require statemnet automatically go to the package inside the “node_modules” folder?
$ npm init
Creates a node project
$ npm -save install tmi.js
Declares tmi.js as a dependancy of the project that you can then require.
package.json and your js file can sent to production and then
$ npm install
Will fetch and install everything in package.json
So, I’m sending the package.json and the JS file, and get the streamer to do “npm install”?
Those commands are valid for Mac and Linux. But not for Windows.
I don’t deploy to Windows nor do I get casters to run anything.
Casters just need to cast, not run infrastructure.
They work fine on my Windows. (Some optional dependencies fail because I don’t have the bloated python 2 installed though)
I concede the point.
I’ve never use Node/NPM on Windows and don’t have much intention to
So I could only talk from experience
There are multiple ways to distribute your Node.js application…
If you want to put extra work in your project by creating a GUI and distribute your application without having to download Node.JS, I would recommend using Electron. Here is how to use tmi.js with Electron and package / distribute your application on multiple platforms.
If you don’t want to create a GUI but want to package your application into a single .exe file, I would recommend EncloseJS, but it is not free. There are free versions out there doing the same thing (like JXCore), but they are not fully supporting ES6 features yet.
Finally, if you don’t want to package your application, you will have to create a README file with all the steps required to install and run your application. Follow the steps @BarryCarlyon provided and you don’t need to provide your node_modules directory. Since you are going in production with your application, I would recommend installing your packages as exact version dependencies using
npm install <package_name> --save --save-exact
Thank you for the help! I actually managed to somehow get around using NodeJS for the subscriber alert, I finally got the websockets to work, so now it signs in using “justinfan1234” or whatever, and listens to chat. (I still use NodeJS for my actual chat bot)
The only few problems I came across were with CLR Browser not liking the order of my code, which was really strange.
But I believe I now have a fully working, custom subscriber alert!
Thanks everyone for the help, I appreciate it.
If you’re already using node, tmi.js is obviously the easiest way to go about this, but it doesn’t really matter how you end up doing it because all you really need to do is be able to pass a variable to your animation.
With edge animate, you should be able to just set it up to accept a variable for the name to display on the sub alert, so all you have to do is pass the name of the subscriber to the function that fires the animation (I’m assuming that is what you were going for).
Yes, the way I did it was I split the message by separating spaces. I called that “cmd”, so cmd was the first word, i.e. the username of the subscriber… In a future update I’ll use the same thing for the amount of months they subscribed for, and add a separate textbox for that.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.