keep the same api for node & browser

only when requiring the index