Skip to content

Instantly share code, notes, and snippets.

@tgriesser
Last active August 29, 2015 14:17
var chunksize = 50;
return (function next(items) {
if (!items.length) { return; }
return knex('sites')
.insert(items.slice(0, chunksize))
.then(function () {
return next(items.slice(chunksize));
});
})(data())
.then(function() { return deps.updateSeq('sites') });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment