Socket
Socket
Sign inDemoInstall

amazon-review-stream

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amazon-review-stream

Node Transform Stream for parsing Amazon Reviews from the Snap dataset into JavaScript objects


Version published
Maintainers
1
Created
Source

Amazon Review Stream

travis-ci.org

Node Transform Stream for parsing the SNAP Amazon Review datasets into JavaScript objects.

Usage

Assuming you've saved a SNAP dataset locally.

var fs = require('fs'),
    reviews = require('amazon-review-stream');

var reviewStream = fs.createReadStream('./Arts.txt.gz').pipe(reviews());

reviewStream.on('data', function(item) {
    console.log('Product: %s', item.product.title);
    console.log('Review: %s', item.review.summary);
});

Of course if you're a very patient person, you could just stream directly from the SNAP site. Keep in mind this below sample will pull down 4.4GB of data if you sit through it...

var request = require('request'),
    reviews = require('amazon-review-stream');

var reviewStream = request('http://snap.stanford.edu/data/amazon/Books.txt.gz').pipe(reviews());

reviewStream.on('data', function(item) {
    console.log('Review: %s', item.review.summary);
});

Keywords

FAQs

Package last updated on 27 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc