I have always done my DB connection through a file like "connection.js" and it contains the sensitive data like password, user, host, etc. required for creating a db connection.
Is there an industry practice for dealing with this? Or a best way of "securing" the file without exposing like passwords and such that other people can snoop and eventually find the connection string and information so that they can connect to the db?