// main.js running on the user's browser fetch('data/index.json').then(response => { return response.json(); }).then(json => { index = elasticlunr.Index.load(json); });