New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

convert-json

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-json

auto detect file type and convert it to json format

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Convert JSON

Build Status

Auto detect different type of file format and convert it into JSON.

Support

  • csv
  • xlsx
  • xls
  • xml
  • tsv

Install

npm install convert-json

Sample

var cv_json = require('..');

cv_json({
    // now supporting csv, xls, xlsx, tsv, xml format
    input: __dirname + '/number_format.xls',
    output: null
  }, function(err, result) {
    if(err) {
      console.error(err);
    }else {
      console.log(result);
    }
  
  }
  );

In config object, you have to enter an input path. But If you don't want to output any file you can set to null.

input string to csv

if you input string istead a file path, bring a type parameter

cv_json({
    type: 'csv',
    input: "<csv string...>",
    output: null
  }, function(err, result) {
    if(err) {
      console.error(err);
    }else {
      console.log(result);
    }
  
  }
  );

License

MIT @chiljung

Keywords

FAQs

Package last updated on 05 Apr 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