Skip to content

readable stream of bacon ipsum content from baconipsum dot com

License

Notifications You must be signed in to change notification settings

danjarvis/bacon-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bacon-stream

readable stream of bacon ipsum content from baconipsum.com

Usage

var bacon = require('bacon-stream');

// pipe to stdout
bacon('meat-and-filler').pipe(process.stdout);

Methods

bacon(options);

Creates a new bacon-stream with the specified options. If options are not specified the defaults will be used:

{
  type: 'meat-and-filler',   // 'all-meat' for meat only
  paras: 5,                  // number of paragraphs
  sentences: 0,              // number of sentences (overrides paragraphs)
  startWithLorem: false,     // start first paragraph with 'Bacon ipsum dolor sit amet'
  https: false               // https://baconipsum.com/api/
}

Shorthand to set just type:

bacon('all-meat'); // {type: 'all-meat'}

Shorthand to set just paras:

bacon(10); // {paras: 10}
bacon().om(options);

Adds another request to the queue using the specified options.

bacon.nom(options);

Adds another request to the queue using the specified options.

Note that om() and nom() return this so they can be chained to build up a queue of varying deliciousness:

bacon('all-meat').om({sentences: 20}).nom({type: 'all-meat', paras: 10}).pipe(process.stdout);

The example above will make 3 API requests to baconipsum.com.

Install

npm install bacon-stream

License: MIT

About

readable stream of bacon ipsum content from baconipsum dot com

Resources

License

Stars

Watchers

Forks

Packages

No packages published