diff --git a/lib/emport.js b/lib/emport.js index c8eccda..de51391 100644 --- a/lib/emport.js +++ b/lib/emport.js @@ -3,7 +3,7 @@ Example usage: - emport 'app.coffee', path: 'frontend', map: + emport 'app.coffee', paths: [ 'frontend' ], map: 'vendor/jquery.js' : exports: '$' , (err, js) -> throw err if err? @@ -15,8 +15,12 @@ on). Here's a rough overview of what happens when `emport` is called: -* The base path is scanned (infinitely deep) for .js and .coffee files -* All of those files are read into memory, in parallel +* If no base paths are provided - via the `paths` argument - the directory of + the target file is used. +* The base paths are scanned for all files matching the optional glob or + against the default glob pattern - all js and coffee files, + infinitely deep +* All of the matched files are read into memory, in parallel * Each file is scanned for the special import and export comments * An `emportMap` data strcuture is built up containing: * The file name (relative to the base path) @@ -40,9 +44,6 @@ Here's a rough overview of what happens when `emport` is called: concatenate them together. If the filename has a `.coffee` extension then its compiled first. * Finally the callback is called with that string as the second arg. - -n.b. The base path is either the value of options.path or the directory that -targetFilename is in. */ (function() { diff --git a/src/emport.coffee b/src/emport.coffee index ee73a81..ae007ce 100644 --- a/src/emport.coffee +++ b/src/emport.coffee @@ -2,7 +2,7 @@ Example usage: - emport 'app.coffee', paths: [ 'frontend **/*.js' ], map: + emport 'app.coffee', paths: [ 'frontend' ], map: 'vendor/jquery.js' : exports: '$' , (err, js) -> throw err if err? @@ -17,8 +17,8 @@ Here's a rough overview of what happens when `emport` is called: * If no base paths are provided - via the `paths` argument - the directory of the target file is used. * The base paths are scanned for all files matching the optional glob or - against the default glob: `**/*.@(js|coffee)` (all js and coffee files, - infinitely deep). + against the default glob pattern - all js and coffee files, + infinitely deep * All of the matched files are read into memory, in parallel * Each file is scanned for the special import and export comments * An `emportMap` data strcuture is built up containing: