Socket
Socket
Sign inDemoInstall

evented-report

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

evented-report

[![NPM version](https://badge.fury.io/js/evented-report.png)](http://badge.fury.io/js/evented-report)


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Evented Report

NPM version

Simple wrapper to node-csv for using events to pump data through the csv pipes.

Example

Sometimes you need to do several separate queries and compose them to to form your output. Here's simple, but common use case:

class JellyBeanInventory extends require 'evented-report'
  # Set column headers to make emitting data clear & explicit.  It also creates a csv header row.
  columns: ['Flavor', 'My Tasting Notes', 'Quantity']

  run: ->
    JellyBean.find (err, jellies) ->
      for jelly in jellies
        @emit 'data',
          Flavor: jelly.name
          'My Tasting Notes': note.notes
          Quantity: jelly.quantity

      @emit 'end'


jbi = new JellyBeanInventory()
jbi.toCSV(process.stdout)       # Give it an output stream!

Contributing

$ git clone https://github.com/goodeggs/evented-report && cd evented-report
$ npm install
$ npm test

Code of Conduct

Code of Conduct for contributing to or participating in this project.

License

MIT

Module scaffold generated by generator-goodeggs-npm.

FAQs

Package last updated on 11 Jul 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