node.js - Splitting big main file in modules: can modules functions access main.js variables and modify them? -
i have file named server.js 1267 lines of code right now, , want modularize file make better, don't know if possible, since didn't have intention modularize file in begin(i didn't think file big).
have bunch of functions related db, control application , others, i'd split functions in different files(eg: db functions in db.js), i've run problem:
i'm using variables inside functions inside server.js, can't read/modify them. should done?
Comments
Post a Comment