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

fauna-dumpify

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fauna-dumpify

Javascript package to dump fauna data into a CSV

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

fauna-dumpify

Library responsible for iterating over given collections and write a CSV file per collection on a given path.

Usage API:

faunaDump (key: string, outputPath: string, options?: {
  collections?: Array<string>, // defaults to all collections
  headers?: (collection: string) => Array<string>, // allows you to specify which headers to be sent to the csv file
  startPointInTime?: Date, // sets the starting point of what documents to filter, use this with `faunaLambda` for better results
  endPointInTime?: Date, // at what point in time are the results valid
  pageSize?: Number, // how many documents to paginate for performance reasons (default: 1000)
  headerTransformer?: (header: string) => string, // allows you to rename headers
  dataTransformer?: (header, data) => data[header], // allows you to make changes to each row data
  appendData?: (_, data) => data, // appends data to each row data
  faunaLambda?: (faunaQueryBuilder, collection), => faunaQueryBuilder // allows you to modify the fauna query to your own needs
  onCollectionProgress?: (progress) => {} // reports on the progress of each collection fetching process.
}): Promise<string>

Example:

faunaDump(faunaKey, outputPath, {
  collections: ['Token', 'User'],
  headers: (collection) => {
    if (collection === 'User') {
      return ['id', 'name', 'picture', 'email', 'issuer', 'github', 'public_address', 'inserted_at', 'updated_at']
    }
    return ['id']
  },
  dataTransformer: (header, allData, collection) => {
    if (header === 'inserted_at') return allData.created?.value
    return allData[header]
  }
})

Keywords

FAQs

Package last updated on 29 Oct 2021

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