How to use the couchimport.previewURL function in couchimport

To help you get started, we’ve selected a few couchimport examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ibm-watson-data-lab / simple-search-service / lib / inference.js View on Github external
var infer = function(filename, callback) {
  var f = filename.toLowerCase();
  var delimiter = (f.match(/csv/))? ",": "\t";
  
  if (filename.indexOf("://") === -1) { //uploaded file
	  couchimport.previewCSVFile(filename, { COUCH_DELIMITER: delimiter}, function(err, data) {
		  handleResponse(err, data, callback);
	  });
  }
  else { //file url
	  couchimport.previewURL(filename, { COUCH_DELIMITER: delimiter}, function(err, data) {
		  handleResponse(err, data, callback);
	  });
  }
};

couchimport

CouchDB import scripts

Apache-2.0
Latest version published 2 days ago

Package Health Score

73 / 100
Full package analysis