Neolithic Populous Metropolis

    omit-stream

    0.1.0 • Public • Published

    omit-stream build status

    Object stream that omits specified keys from output.

    testling badge

    Example

    var stream = omit('not', 'for', 'output')
    var concat = require('concat-stream')
    var omit = require('omit-stream')
    var assert = require('assert')
     
    stream.pipe(concat(function (body) {
      assert.deepEqual(body, [
        {'a': 'b'},
        {'c': 'd'},
        {'e': 'f'}
      ])
    }))
     
    var input = [
      {
        'a': 'b',
        'not': true,
        'for': 100
      },
      {
        'c': 'd',
        'output': 'string'
      },
      {
        'e': 'f',
        'not': 200,
        'output': {type: 'object'}
      }
    ]
     
    for (var i = 0; i < input.length; i++) {
      stream.write(input[i])
    }
    stream.end()

    Methods

    var stream = omit(keys, to, omit, ...)

    Any key passed as an argument will be removed from the object before it is passed to the next stream.

    License

    MIT

    Keywords

    none

    Install

    npm i omit-stream

    DownloadsWeekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • nrw