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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -