lib/swagger-koa/index.js
function parseCoffeeDocs(file, fn) {
  fs.readFile(file, function(err, data) {
    if (err) {
      fn(err);
    }

    var js = coffee.compile(data.toString());
    var regex = /\/\**([\s\S]*?)\*\//gm;
    var fragments = js.match(regex);
    var docs = [];

    for (var i = 0; i < fragments.length; i++) {
      var fragment = fragments[i];
      var doc = doctrine.parse(fragment, {unwrap: true});

      docs.push(doc);

      if (i === fragments.length - 1) {
        fn(null, docs);
      }
    }
  });
}
function parseCoffeeDocs(file, fn) {
  fs.readFile(file, function(err, data) {
    if (err) {
      fn(err);
    }

    var js = coffee.compile(data.toString());
    var regex = /\/\**([\s\S]*?)\*\//gm;
    var fragments = js.match(regex);
    var docs = [];

    for (var i = 0; i < fragments.length; i++) {
      var fragment = fragments[i];
      var doc = doctrine.parse(fragment, {unwrap: true});

      docs.push(doc);

      if (i === fragments.length - 1) {
        fn(null, docs);
      }
    }
  });
}
function parseCoffeeDocs ( file , fn ) { fs . readFile ( file , function ( err , data ) { if ( err ) { fn ( err ) ; } var js = coffee . compile ( data . toString ( ) ) ; var regex = / \/\**([\s\S]*?)\*\/ / gm ; var fragments = js . match ( regex ) ; var docs = [ ] ; for ( var i = 0 ; i < fragments . length ; i ++ ) { var fragment = fragments [ i ] ; var doc = doctrine . parse ( fragment , { unwrap : true } ) ; docs . push ( doc ) ; if ( i === fragments . length - 1 ) { fn ( null , docs ) ; } } } ) ; }
Parse coffeeDoc from a coffee file
@api    private
@param  {String}   file
@param  {Function} fn
Parse coffeeDoc from a coffee file