Skip to content

Instantly share code, notes, and snippets.

@chrislaughlin
Created October 10, 2016 22:34
Show Gist options
  • Save chrislaughlin/72db8ad161f3d063ecee48ab3f437705 to your computer and use it in GitHub Desktop.
Save chrislaughlin/72db8ad161f3d063ecee48ab3f437705 to your computer and use it in GitHub Desktop.
Print the name and description of 50 transactions from the npm repo stream
const ChangesStream = require('changes-stream');
const db = 'https://replicate.npmjs.com';
var changes = new ChangesStream({
db: db,
include_docs: true
});
let count = 0;
changes.on('data', function(change) {
if (count > 50) {
process.exit(0);
}
const { name,
description,
} = change.doc;
console.log('-------------');
console.log(name);
console.log(description);
console.log('-------------');
count++;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment