javascript - call to functiolity just one time in node js -


there method need run once when node application started ,i think put in server.js executable file application im not sure right way go,which other option can use in case?

depending on when it's required run, may suitable put function separate javascript file, , execute part of npm start script within package.json?

based on comment below stating child process. appropriate execute server file, best practice abstract function out separate file, require server file , call it.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -