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

data-exporter

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-exporter

Allows to save any content to disk, as JSON, CSV or any other desired format, from the browser

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Classes

Exporter

Exporter

Kind: global class

  • Exporter
    • new Exporter()
    • .module.exports
    • .convertJSONToCsv(json)string
    • .stringifyJSON(json, [pretty])string
    • .save()
    • .saveJSON()
    • .saveCSV()

new Exporter()

Exporter class

Exporter.module.exports

Kind: static class of Exporter

new module.exports(data, filename, extension, mimeType)

Creates an instance of Exporter.

ParamTypeDescription
dataanyData to convert
filenamestringFilename for the resulting file
extensionstringExtension to use for the file. Use the EXTENSIONS enum as helper
mimeTypestringMIME expresssion. Use the MIMES enum as helper

Exporter.convertJSONToCsv(json) ⇒ string

Converts JSON to CSV

Kind: static method of Exporter
Returns: string - String representation of a CSV

ParamTypeDescription
jsonobject | Array.<object>JSON to convert to CSV

Exporter.stringifyJSON(json, [pretty]) ⇒ string

Stringifies JSON

Kind: static method of Exporter
Returns: string - Stringified JSON

ParamTypeDefaultDescription
jsonobject | Array.<object>JSON to stringify
[pretty]booleanfalseWhether to use nice spacing

Exporter.save()

Triggers file download

Kind: static method of Exporter

Exporter.saveJSON()

Shortcut to save as JSON Processes JSON directly

Kind: static method of Exporter

Exporter.saveCSV()

Shortcut to save as CSV Processes JSON as CSV

Kind: static method of Exporter

MIMES

Kind: global enum

EXTENSIONS

Kind: global enum

Keywords

FAQs

Package last updated on 07 Aug 2020

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