Sunday, 30 April 2017

Separate functions in node.js file

I just want to separate functions in my node.js file I don't know how to do it.
Here is an exemple :

var actions = {
    send1() { //function 1 },
    send1a() { //function 1a },
    send2() { //function 2 },
    send2a() { //function 2a },
};


I want to export send1() & send1a() in function1.js
and send2() & send2a() in function2.js in order to have clean files.

How can I do that correctly ? Thank you in advance.



via Pablo DelaNoche

No comments:

Post a Comment