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 Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "evented-report",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -5,0 +5,0 @@ "author": "Good Eggs <open-source@goodeggs.com>",

@@ -5,8 +5,30 @@ # Evented Report

[![Build Status](https://travis-ci.org/goodeggs/evented-report.png)](https://travis-ci.org/goodeggs/evented-report)
Simple wrapper to [node-csv](https://www.npmjs.org/package/csv) for using events to pump data through the csv pipes.
## Example
Simple wrapper to [node-csv](https://www.npmjs.org/package/csv) for using events to pump data through the csv pipes.
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

@@ -13,0 +35,0 @@

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