0.0.27 • Published 1 year ago

@compass-marketing/puppet-stream v0.0.27

Weekly downloads
18
License
ISC
Repository
github
Last release
1 year ago

Puppet Stream

Puppet Stream is a node library that makes it easy to stream scraping requests to Puppeteer using native NodeJS streams.

Getting Started

Install

  npm i @compass-marketing/puppet-stream

Important: Nightcrawler has a dependency to puppeteer-core. This allows for a custom executable to be used if desired. If you would like to use the chrome executable bundled with puppeteer, please install it like so:

npm i puppeteer

Usage

const Nightcrawler = require('@compass-marketing/puppet-stream')
const JSONStream = require('JSONStream')

let nc = new Nightcrawler()
let qStream = nc.createStream()

// Pipe to standard out
qStream.pipe(JSONStream.stringify(false)).pipe(process.stdout)

let q = nc
  .get('http://example.com')
  .waitFor('body')
  .groupBy('body > div')
  .select({ title: nc.$('p') })

qStream.write(q)

qStream.end()
0.0.27

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.26

1 year ago

0.0.23

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago