From 7e7261f0ef2e1044775eec2824a863b3b77966c2 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Sun, 25 Jan 2015 19:54:43 -0500 Subject: [PATCH] change public api --- lib/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 738f244..71236d0 100644 --- a/lib/index.js +++ b/lib/index.js @@ -95,11 +95,11 @@ var parseExpressions = function(expr){ return expressions; }; -module.exports.parseDataFile = function(filename, options){ - return module.exports.parseData(fs.readFileSync(filename, 'utf-8'), options); +module.exports.parseFile = function(filename, options){ + return module.exports.parseContents(fs.readFileSync(filename, 'utf-8'), options); }; -module.exports.parseData = function(contents, options){ +module.exports.parseContents = function(contents, options){ options = options || {}; var tolerant = (options.tolerant === undefined)? true: options.tolerant; var parsed = esprima.parse(contents, {comment: true, loc: true, tolerant: tolerant}); @@ -119,3 +119,5 @@ module.exports.parseData = function(contents, options){ return results; }; + +module.exports.parse = module.exports.parseFile;