def search_text(file, text, new_text):
    f = open(file, 'r')
    content = f.read()
    print(text, content.find(new_text))
    content = content.replace(text, new_text)
    f.close()
    with open(file, 'w') as f:
        f.write(content)

file = './plugins/02-connection.js'
text1 = "mode = 'dev'"
newtext1 = "mode = 'prod'"
search_text(file, text1, newtext1)