Convert db/index to JavaScript