How to use the valid-url.default.isUri function in valid-url

To help you get started, we’ve selected a few valid-url 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 repetere / modelscript / src / csv.js View on Github external
export function loadCSV(filepath, options) {
  if (validURL.isUri(filepath)) {
    return loadCSVURI(filepath, options);
  } else {
    return new Promise((resolve, reject) => {
      const csvData = [];
      csv(options).fromFile(filepath)
        .on('json', jsonObj => {
          csvData.push(jsonObj);
        })
        .on('error', err => {
          return reject(err);
        })
        .on('done', error => {
          if (error) {
            return reject(error);
          } else {
            return resolve(csvData);

valid-url

URI validation functions

Unrecognized
Latest version published 11 years ago

Package Health Score

71 / 100
Full package analysis

Similar packages