-
-
Save SaraVieira/733e8bd49afbc4e9b163dc8363063f1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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