1.0.3 • Published 7 years ago

tap-lexer v1.0.3

Weekly downloads
14
License
CC0-1.0
Repository
github
Last release
7 years ago

tap-lexer

Receives a stream of TAP lines and emits JS objects of types and values.

Install

npm install tap-lexer

Usage

const tapLexer = require('tap-lexer')
const through  = require('through2')

process.stdin // stream that emits TAP
  .pipe(tapLexer())
  .pipe(though.obj(function (chunk, enc, cb) { // objectMode stream
    // `chunk` is a TAP token object
  }))

process.stdin
  .pipe(tapLexer())
  .on('data', token => {})
  • token: object
    • type: string, unknown
      • version
      • plan
      • test
      • bailout
      • diagnostic
      • yaml
      • unknown
    • value: string the value of the input associated with a type (the "plan" line if type is "plan")