Skip to content

Instantly share code, notes, and snippets.

@SaraVieira
Created February 20, 2020 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SaraVieira/733e8bd49afbc4e9b163dc8363063f1d to your computer and use it in GitHub Desktop.
Save SaraVieira/733e8bd49afbc4e9b163dc8363063f1d to your computer and use it in GitHub Desktop.
try {
await new Promise((resolve, reject) => {
index.browseObjects({
query: '',
facets: ['npm_dependencies.dependency'],
maxValuesPerFacet: 36,
attributesToRetrieve: [
'objectID',
'title',
'description',
'author',
'template',
'npm_dependencies'
],
batch: batch => {
if (hits.length >= 10000) {
resolve()
return
} else {
console.log('getting sandboxes', hits.length)
hits = hits.concat(batch)
}
}
})
})
} catch (e) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment