Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

albedo

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

albedo

node.js module for creating CSV reports from database queries

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

albedo

node.js module for generating cvs reports from databases

How to use:

call:

albedo.processReport({options}, callback(err, report) {} );

The options object takes the following parameters:

{
  location: "/path/to/folder/for/report",
  name: "report_name",
  query: "SELECT * FROM ALBEDO",
  connection: {
    type: "mysql",
    host: "localhost",
    user: "root",
    password: "password",
    database: "bigdata"
  },
  removeOlderThan: "5",
  process_row: function(row) {
    row.foo = 'bar';
    return row;
  }
}

All options are required except for removeOlderThan and process_row.

removeOlderThan will allow Albedo to remove any reports matching the same name that are older than the specified number of days. By default, it will not remove any reports if this value is not specified. process_row can be either a function or an array of functions, which will be used to modify data after it comes back from the database. For example, you may want to use it to separate JSON fields into two separate columns in the CSV output. Each function takes in a row as input, and must return the modified row.

The report object in the callback will return a report object if successful, which contains the following information:

{
  name: "report_name_YYYY-MM-DD_HH-mm-ss.csv",
  path: "/path/to/folder/for/report"
}

Otherwise it will return an error string.

Keywords

FAQs

Package last updated on 24 Mar 2015

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