nl_tokens: Promise to load a file s contents
pl_tokens: function readFilePromise ( filename ) { var deferred ; deferred = Q . defer ( ) ; fs . readFile ( filename , 'utf-8' , function ( err , contents ) { if ( err ) { if ( err . code === 'ENOENT' ) { debug ( err . code + ': ' + filename ) ; return deferred . resolve ( ) ; } debug ( err + ' ' + filename ) ; // TODO: better error handling deferred . reject ( err ) ; } else { debug ( 'read ' + <mask> ) ; deferred . resolve ( contents ) ; } } ) ; return deferred . promise ; }