How to use the cson.parseSync function in cson

To help you get started, we’ve selected a few cson 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 redhotvengeance / browserify-data / lib / browserify-data.js View on Github external
function end() {
    if (/\.json$/.test(file)) {
      this.queue('module.exports = ' + data);
      this.queue(null);
    }
    else if (/\.cson$/.test(file)) {
      this.queue('module.exports = ' + JSON.stringify(cson.parseSync(data)));
      this.queue(null);
    }
    else if (/\.ya?ml$/.test(file)) {
      var docs = [];
      yaml.safeLoadAll(data, function(doc) {
        docs.push(doc);
      });
      var result = docs.length===1 ? docs[0] : docs;
      this.queue('module.exports = ' + JSON.stringify(result));
      this.queue(null);
    }
  }

cson

CoffeeScript-Object-Notation Parser. Same as JSON but for CoffeeScript objects.

Artistic-2.0
Latest version published 10 months ago

Package Health Score

66 / 100
Full package analysis