{"_id":"nodefront","_rev":"58-6b0b0ca4664ee22042aa711c5f1d8b8a","name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","dist-tags":{"latest":"1.0.7"},"versions":{"0.0.1":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"karthik.ksv@gmail.com"},"version":"0.0.1","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"0.5.2","jade":"0.26.3","mime":"1.2.6","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"readme":"# Nodefront\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\nnpm install -g nodefront\n```\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade and Stylus files to HTML and CSS. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade) and Stylus (\\*.styl, \\*.stylus) files in the current directory without recursing (see the recursive option) and compile them to their HTML and CSS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    `_ styles.styl\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html` and `styles.styl` will be compiled to `styles.css`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    `_ styles.css\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade and Stylus files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images.\n\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact me via email at me [at] karthikv [dot] net.\n","_id":"nodefront@0.0.1","dist":{"shasum":"55983cdeeb5cc5007ad8b49db40b89e27a14f9eb","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.0.1.tgz","integrity":"sha512-RN1p6W+yINJrbC85z3ITK2i3vFXMZq1rKWhvlBuIbQjvwXSLZCz9No/MhVgeDYnEa4S3zkVhB/Lp4fq2y27jCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFyYs7QiaICa5dL4453RTZ2itkMTv+NQlGUZc2q6j4TAAiEAmj9Ws0UkPbaUhZGGEUBA13ZD28btTidn4UpW4yo19fg="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}],"directories":{}},"0.0.2":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"karthik.ksv@gmail.com"},"version":"0.0.2","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"0.5.2","jade":"0.26.3","mime":"1.2.6","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"readme":"# Nodefront\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade and Stylus files to HTML and CSS. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade) and Stylus (\\*.styl, \\*.stylus) files in the current directory without recursing (see the recursive option) and compile them to their HTML and CSS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    `_ styles.styl\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html` and `styles.styl` will be compiled to `styles.css`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    `_ styles.css\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade and Stylus files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.0.2","dist":{"shasum":"d19ddecf89e9e4262af4ee6797d210cd80fe83dc","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.0.2.tgz","integrity":"sha512-4gBOYeZr32K8wpuWy7wK6VL5bKyKPFCYMN9jFvA8LdH8MSpixzYiOAlMJSmjD+qPxjBMsAKbvZtB8Mpxc5gabw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqfDOqRYWXe0KRhIxKvVzwnlMpMMwJAmDaT9TSOzzDkAIhAJiDFuwI2qO7l/H7Dh8s5YqPyTnmStREUlrHCNHH6jKZ"}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}],"directories":{}},"0.0.3":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"0.0.3","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"git://github.com/karthikv/commander.js.git","jade":"0.26.3","mime":"1.2.6","mocha":"1.3.0","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","sandboxed-module":"0.1.3","should":"1.0.0","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"scripts":{"test":"make test"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade and Stylus files to HTML and CSS. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade) and Stylus (\\*.styl, \\*.stylus) files in the current directory without recursing (see the recursive option) and compile them to their HTML and CSS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    `_ styles.styl\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html` and `styles.styl` will be compiled to `styles.css`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    `_ styles.css\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade and Stylus files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.0.3","dist":{"shasum":"e027c7e25f50c15816ef5ffbd86c7d9d2819c9c0","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.0.3.tgz","integrity":"sha512-86AlzdsXDssKO2o7PeUFh3Y9bsRCDZnnNP6KxHY4UrxWg7YWVtW3P3baJNyUlbzO7j0KyQoZPwS+MKkNWaOVDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpKi46hX5cqy9iQwRiynzzFhdRL9DOjNHvIl/CVUd8uQIgAzOxNaMAJa+PDKrQmCQZ2EUANdejhzLfXFU3UF5lAW4="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}],"directories":{}},"0.0.4":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"0.0.4","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"git://github.com/karthikv/commander.js.git","coffee-script":"1.3.3","jade":"0.26.3","mime":"1.2.6","mocha":"1.3.0","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","sandboxed-module":"0.1.3","should":"1.0.0","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"scripts":{"test":"make test"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade and Stylus files to HTML and CSS. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade) and Stylus (\\*.styl, \\*.stylus) files in the current directory without recursing (see the recursive option) and compile them to their HTML and CSS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    `_ styles.styl\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html` and `styles.styl` will be compiled to `styles.css`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    `_ styles.css\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade and Stylus files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.0.4","dist":{"shasum":"1a0e5fa1e501294ac0121a7d5fdd728ecf7271e3","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.0.4.tgz","integrity":"sha512-tYSKyv2zHOk8b2XiBEbVcLB9YdNJdVmTFlNSH38CEYOfmVwiUTm6QafUONItl/cvE6Slc5b1q6m1Vb3cx5fmqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB1JQ1Daz+aoOI50lNMYtSBDrMPjXpcAocHTCoVTi7JsAiBNRzMex9B5PFBRx3aBDV1M0EsznRLhOt3huwC8Tasahw=="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}],"directories":{}},"0.0.5":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"0.0.5","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"git://github.com/karthikv/commander.js.git","coffee-script":"1.3.3","jade":"0.26.3","mime":"1.2.6","mocha":"1.3.0","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","sandboxed-module":"0.1.3","should":"1.0.0","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"scripts":{"test":"make test"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nIf you need to upgrade nodefront, simply run:\n\n```bash\n$ npm update -g nodefront\n```\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade, Stylus, and CoffeeScript files to HTML, CSS, and JavaScript, respectively. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade, Stylus, and CoffeeScript files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.0.5","dist":{"shasum":"fb1ef1babb25d1c5a29d1d48415ad008fdd0ce21","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.0.5.tgz","integrity":"sha512-bzxdDERiUVSqKvpPLDDt8qMRbsAGiB5Rk4tfkmtBbceP7M5vezb12XLTPfddE+MhosqjbSwPb/Q724RhKSMqnQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCz16cN1eZnzM8UnlHIlCqmQt1VoM/NDIjlvNxcdC/AQIgMEHFdJmON4f15diYKMDpTN3L0qGDez/mNMT1EhGec+E="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}],"directories":{}},"0.0.6":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"0.0.6","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"git://github.com/karthikv/commander.js.git","coffee-script":"1.3.3","jade":"0.26.3","mime":"1.2.6","mocha":"1.3.0","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","sandboxed-module":"0.1.3","should":"1.0.0","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"scripts":{"test":"make test"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nIf you need to upgrade nodefront, simply run:\n\n```bash\n$ npm update -g nodefront\n```\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade, Stylus, and CoffeeScript files to HTML, CSS, and JavaScript, respectively. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade, Stylus, and CoffeeScript files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\nHostname: `nodefront compile -h/--hostname [hostname]` sets which hostname to serve files on. This must be used in conjunction with the live or serve option (see above). If not specified, live or serve defaults to serving files on localhost.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.0.6","dist":{"shasum":"e8b122aef1518bf09d209da28d17e1306d75bff0","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.0.6.tgz","integrity":"sha512-Sh0YgiWd5k/oDK44Gzqr2irg9QVgZjXHHDDYa5lz/pkw/lC39VZtlHnIgxRZlOcOIpUdlTWRhSg0GdviL4NIcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHfmhC9H9oIavQX63tsYyuIm1bS6Lyfy6wTWoos1pnOAAiEAngnhrDQPeKik3wTm7jmUFnYIM4r/aYJ9UtR7IJwzKWc="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}],"directories":{}},"0.0.7":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"0.0.7","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"git://github.com/karthikv/commander.js.git","coffee-script":"1.3.3","jade":"0.26.3","mime":"1.2.6","mocha":"1.3.0","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","sandboxed-module":"0.1.3","should":"1.0.0","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"scripts":{"test":"make test"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade, Stylus, and CoffeeScript files to HTML, CSS, and JavaScript, respectively. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade, Stylus, and CoffeeScript files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\nHostname: `nodefront compile -h/--hostname [hostname]` sets which hostname to serve files on. This must be used in conjunction with the live or serve option (see above). If not specified, live or serve defaults to serving files on localhost.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.0.7","dist":{"shasum":"ed1a1907c904ff6a4e240ac25eb4af783e9261b0","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.0.7.tgz","integrity":"sha512-PIL+FADDPZlvxCHNhsLdSTAijmrkkFiyCCvj9EAWU+07yg/NxPFPPQct9gB089BE4oItEZ41mfmNxeoeAAb+xQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoDrkHvQ8eBNhtWVfDpf67yF9gXzy+aw7V8v5mtRmkHAIhAMrC/69bPG6ZInla2rVq/gI7NQwvdZT/cFgQwldtxQqU"}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}],"directories":{}},"0.0.8":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"0.0.8","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"git://github.com/karthikv/commander.js.git","coffee-script":"1.3.3","jade":"0.26.3","mime":"1.2.6","mocha":"1.3.0","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","sandboxed-module":"0.1.3","should":"1.0.0","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"scripts":{"test":"make test"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade, Stylus, and CoffeeScript files to HTML, CSS, and JavaScript, respectively. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade, Stylus, and CoffeeScript files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\nHostname: `nodefront compile -n/--hostname [hostname]` sets which hostname to serve files on. This must be used in conjunction with the live or serve option (see above). If not specified, live or serve defaults to serving files on localhost.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.0.8","dist":{"shasum":"489d512f704562b59139a7f3c94bb0a888c20b17","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.0.8.tgz","integrity":"sha512-q1/knNqJB7uBrtSbWwBRcYS4Uhc/zUtOVKXuqsgTwhCtOlv30KPvLluoeBw39n6ytrYN1kHHP3orCLZuq8Tqsw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0iIP5YQm5CIp5aQMk05E2ItLUkOnZSZWp1Bhm5Frx5AiAYCpVVLWUOIzan24zUMzmxWlFkUYWblX06B/JsF9NyKw=="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"0.1.0":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"0.1.0","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"git://github.com/karthikv/commander.js.git","coffee-script":"1.3.3","consolidate-build":"0.0.0","jade":"0.26.3","mime":"1.2.6","mocha":"1.3.0","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","sandboxed-module":"0.1.3","should":"1.0.0","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"scripts":{"test":"make test"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\nHostname: `nodefront compile -n/--hostname [hostname]` sets which hostname to serve files on. This must be used in conjunction with the live or serve option (see above). If not specified, live or serve defaults to serving files on localhost.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.1.0","dist":{"shasum":"c5be3b96dea69ecf2c0a2173cb4ccbf342e0ee6c","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.1.0.tgz","integrity":"sha512-6LPWRR4n1OKQolGCmwcOoalyGe7HbN8ln0EvrHcW3inOCu8ccR7Hwddtf8yaUvFVp4aK2wiY2IcmwrFhIHkUyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICasJ235762pA2f+eCMg9sO0OzpDoFomSHkY6LI3EMb2AiEA+l1pRhEqQUkfL4Z77NksTmNtDttoGdWoy3cQQkS5od8="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"0.1.1":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"0.1.1","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"adm-zip":"0.1.4","commander":"git://github.com/karthikv/commander.js.git","coffee-script":"1.3.3","consolidate-build":"0.0.0","jade":"0.26.3","mime":"1.2.6","mocha":"1.3.0","nconf":"0.6.0","q":"0.8.5","request":"2.9.203","sandboxed-module":"0.1.3","should":"1.0.0","socket.io":"0.9.6","stylus":"0.27.2","uglify-js":"1.3.2"},"scripts":{"test":"make test"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\nHostname: `nodefront compile -n/--hostname [hostname]` sets which hostname to serve files on. This must be used in conjunction with the live or serve option (see above). If not specified, live or serve defaults to serving files on localhost.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@0.1.1","dist":{"shasum":"2f5a94bce5c7267086f931a28a49dc6cf09e2cb8","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-0.1.1.tgz","integrity":"sha512-U5v0T+DNXTMsV5p3ctp0xxm33v1wk1J1DkoWPAW+VE1HjZP/S6L3c1Zehy52fFjM9Hk1eGDfK7lKEwDSAILP1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBhlK51/EUHxYXbDYQaFKo/aqfphrxPCNuky++8A5OuAAiEAlCi08hREwa9KOCi9BjVzdDiwbEpwB+h6X7XrA4Il9V4="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"1.0.0":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"1.0.0","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"coffee-script":"1.3.x","commander":"1.0.x","commander-config":"0.x.x","consolidate-build":"0.x.x","jade":"0.26.x","mime":"1.2.x","nconf":"0.6.x","node-zip":"0.0.x","q":"0.8.x","request":"2.9.x","socket.io":"0.9.x","stylus":"0.27.x","uglify-js":"1.3.x"},"devDependencies":{"mocha":"1.x.x","sandboxed-module":"0.x.x","should":"1.x.x","zombie":"1.x.x"},"scripts":{"test":"mocha --reporter list","test-fetch":"mocha test/test.fetch.js --reporter list","test-minify":"mocha test/test.minify.js --reporter list","test-insert":"mocha test/test.insert.js --reporter list","test-compile":"mocha test/test.compile.js --reporter list","test-serve":"mocha test/test.serve.js --reporter list"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification.\n\nServe: `nodefront serve` - Serve files on localhost. Automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n### Configuration Files\nLanguage compilers often come with a variety of options. For example, Jade has the option of compressing HTML upon compilation. Nodefront allows you to set these options via configuration files. To do so, simply create a `.nf` directory anywhere in your project tree. This means that `.nf` can be present directly in your project directory or in any of its parent directories. Then, add a `compile.json` or `compile.yml` file with a `compilerOptions` map. Any key-value pairs you add to this map will be passed on to the compiler. For example, to tell Jade to output pretty HTML instead of compressing it, you can use the following `.nf/compile.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"pretty\": true\n    }\n}\n```\n\nThe YAML equivalent, `.nf/compile.yml`, would look like:\n\n```yml\ncompilerOptions:\n    pretty: true\n```\n\n## Serve Command\n### Usage\n\n```bash\n$ nodefront serve [options] [port] [hostname]\n```\n\nThe serve command will serve all static files in the current directory and subdirectories on a local Node.js server. The current directory will act as the effective root of the server. Files will be accessible by the URL http://[hostname]:[port]/[path], where [path] is the path to the file relative to the current directory. [hostname] and [port] are provided as explicit parameters on the command-line and default to localhost and 3000, respectively.\n\n### Example\nIf the directory structure looks like:\n\n    .\n    |_ index.html\n    |_ css\n      `_ styles.css\n    |_ js\n      `_ script.js\n\nRunning `nodefront serve` in the directory with no options would allow you to access the three files above using the following URLs:\n\nhttp://localhost:3000/index.html would serve ./index.html\nhttp://localhost:3000/css/styles.css would serve ./css/styles.css\nhttp://localhost:3000/css/script.js would serve ./js/script.js\n\n### Options\nCompile: `nodefront serve -c/--compile` will run `nodefront compile -w/--watch` simultaneously. This allows you to modify files that need to be compiled and immediately see the updates in your browser.\n\nLive: `nodefront serve -l/--live` will monitor each HTML page that is served to the browser and all of its CSS/JS dependencies. If the page's source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it will be reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of live mode, the server that is created automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows for communication between the client and the Node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@1.0.0","dist":{"shasum":"3c811ea12e048f95d7ddfa4dc7d4e94f3071c102","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-1.0.0.tgz","integrity":"sha512-jS8CB33mV+dMIx38B7I8jKuRjICvX+DauoVHE3Etl+YWVCdl8qx6SmhKvQcthSiZ3bJHJx6hcVZzRoPrfX40nQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH55LwsKHazakvbqlNhuwmQWH9wqYwQ3KwKHt9L+BL7MAiEArIJ6GxgvInRBJw+0QIIpT7/5xVxIQaRFHUW8UlgG+QQ="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"1.0.1":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"1.0.1","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"coffee-script":"1.3.x","commander":"1.0.x","commander-config":"0.x.x","consolidate-build":"1.x.x","jade":"0.26.x","mime":"1.2.x","nconf":"0.6.x","node-zip":"0.0.x","q":"0.8.x","request":"2.9.x","socket.io":"0.9.x","stylus":"0.27.x","uglify-js":"1.3.x"},"devDependencies":{"mocha":"1.x.x","sandboxed-module":"0.x.x","should":"1.x.x","zombie":"1.x.x"},"scripts":{"test":"mocha --reporter list","test-fetch":"mocha test/test.fetch.js --reporter list","test-minify":"mocha test/test.minify.js --reporter list","test-insert":"mocha test/test.insert.js --reporter list","test-compile":"mocha test/test.compile.js --reporter list","test-serve":"mocha test/test.serve.js --reporter list"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification.\n\nServe: `nodefront serve` - Serve files on localhost. Automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nOutput: `nodefront compile -o/--output [directory]` outputs all compiled files into the given output directory. If not provided, this defaults to the current directory.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n### Configuration Files\nLanguage compilers often come with a variety of options. For example, Jade has the option of compressing HTML upon compilation. Nodefront allows you to set these options via configuration files. To do so, simply create a `.nf` directory anywhere in your project tree. This means that `.nf` can be present directly in your project directory or in any of its parent directories. Then, add a `compile.json` or `compile.yml` file with a `compilerOptions` map. Each key should be a file extension and the value should be map of options to pass to the compiler for that extension. For example, to tell Jade to output pretty HTML instead of compressing it, you can use the following `.nf/compile.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"jade\": { \n            \"pretty\": true\n        }\n    }\n}\n```\n\nThe YAML equivalent, `.nf/compile.yml`, would look like:\n\n```yml\ncompilerOptions:\n    jade:\n        pretty: true\n```\n\n## Serve Command\n### Usage\n\n```bash\n$ nodefront serve [options] [port] [hostname]\n```\n\nThe serve command will serve all static files in the current directory and subdirectories on a local Node.js server. The current directory will act as the effective root of the server. Files will be accessible by the URL http://[hostname]:[port]/[path], where [path] is the path to the file relative to the current directory. [hostname] and [port] are provided as explicit parameters on the command-line and default to localhost and 3000, respectively.\n\n### Example\nIf the directory structure looks like:\n\n    .\n    |_ index.html\n    |_ css\n      `_ styles.css\n    |_ js\n      `_ script.js\n\nRunning `nodefront serve` in the directory with no options would allow you to access the three files above using the following URLs:\n\nhttp://localhost:3000/index.html would serve ./index.html  \nhttp://localhost:3000/css/styles.css would serve ./css/styles.css  \nhttp://localhost:3000/css/script.js would serve ./js/script.js\n\n### Options\nCompile: `nodefront serve -c/--compile` will run `nodefront compile -w/--watch` simultaneously. This allows you to modify files that need to be compiled and immediately see the updates in your browser.\n\nLive: `nodefront serve -l/--live` will monitor each HTML page that is served to the browser and all of its CSS/JS dependencies. If the page's source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it will be reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of live mode, the server that is created automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows for communication between the client and the Node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@1.0.1","dist":{"shasum":"983e5a9afac3d7d6aa46092fd1c3098242d1458f","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-1.0.1.tgz","integrity":"sha512-X5eUcn5Hj4V4dtrrWCrxF+yca+spCHEF/0cfEXTiOccg1ChM40IwqE/F38+vi4lkoQOggD50c9rcuk04vE27Eg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxZrz2LuoFv6fyDsRNQIuIuKczwBULLzQ9f04XHZ4bTQIhAJvHEIUGRVtryknBE4+Evo72hD2Q0X+NI8KZ5Y+2mQ5C"}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"1.0.2":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"1.0.2","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"coffee-script":"1.3.x","commander":"1.0.x","commander-config":"0.x.x","consolidate-build":"1.x.x","jade":"0.26.x","mime":"1.2.x","nconf":"0.6.x","node-zip":"0.0.x","q":"0.8.9","request":"2.9.x","socket.io":"0.9.x","stylus":"0.27.x","uglify-js":"1.3.x"},"devDependencies":{"mocha":"1.x.x","sandboxed-module":"0.x.x","should":"1.x.x","zombie":"1.x.x"},"scripts":{"test":"mocha --reporter list","test-fetch":"mocha test/test.fetch.js --reporter list","test-minify":"mocha test/test.minify.js --reporter list","test-insert":"mocha test/test.insert.js --reporter list","test-compile":"mocha test/test.compile.js --reporter list","test-serve":"mocha test/test.serve.js --reporter list"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification.\n\nServe: `nodefront serve` - Serve files on localhost. Automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nOutput: `nodefront compile -o/--output [directory]` outputs all compiled files into the given output directory. If not provided, this defaults to the current directory.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n### Configuration Files\nLanguage compilers often come with a variety of options. For example, Jade has the option of compressing HTML upon compilation. Nodefront allows you to set these options via configuration files. To do so, simply create a `.nf` directory anywhere in your project tree. This means that `.nf` can be present directly in your project directory or in any of its parent directories. Then, add a `compile.json` or `compile.yml` file with a `compilerOptions` map. Each key should be a file extension and the value should be a map of options to pass to the compiler for that extension. For example, to tell Jade to output pretty HTML instead of compressing it, you can use the following `.nf/compile.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"jade\": { \n            \"pretty\": true\n        }\n    }\n}\n```\n\nThe YAML equivalent, `.nf/compile.yml`, would look like:\n\n```yml\ncompilerOptions:\n    jade:\n        pretty: true\n```\n\n## Serve Command\n### Usage\n\n```bash\n$ nodefront serve [options] [port] [hostname]\n```\n\nThe serve command will serve all static files in the current directory and subdirectories on a local Node.js server. The current directory will act as the effective root of the server. Files will be accessible by the URL http://[hostname]:[port]/[path], where [path] is the path to the file relative to the current directory. [hostname] and [port] are provided as explicit parameters on the command-line and default to localhost and 3000, respectively.\n\n### Example\nIf the directory structure looks like:\n\n    .\n    |_ index.html\n    |_ css\n      `_ styles.css\n    |_ js\n      `_ script.js\n\nRunning `nodefront serve` in the directory with no options would allow you to access the three files above using the following URLs:\n\nhttp://localhost:3000/index.html would serve ./index.html  \nhttp://localhost:3000/css/styles.css would serve ./css/styles.css  \nhttp://localhost:3000/css/script.js would serve ./js/script.js\n\n### Options\nCompile: `nodefront serve -c/--compile` will run `nodefront compile -w/--watch` simultaneously. This allows you to modify files that need to be compiled and immediately see the updates in your browser.\n\nLive: `nodefront serve -l/--live` will monitor each HTML page that is served to the browser and all of its CSS/JS dependencies. If the page's source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it will be reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of live mode, the server that is created automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows for communication between the client and the Node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@1.0.2","dist":{"shasum":"9146bd2ec1abf96fd971d3fea9966b643522e57a","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-1.0.2.tgz","integrity":"sha512-+Q8VpAmaTrpHC2ImsqVFQ2PLiaUdGlRAFJ1b6Xh88mnF85+/lomFvEISStrGNVW7TTzEN3Hg/WiQYLN35PEhnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYWvYUCe0IJ3MVqHUJE6CFByx7w0LB9oQ766Y0GDdtNgIhAK27rBS2Q1JzPw+z48X2szG3Rm3f/wCw2Syuiycc+65J"}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"1.0.3":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"1.0.3","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"coffee-script":"1.3.x","commander":"1.0.x","commander-config":"0.x.x","consolidate-build":"1.x.x","jade":"0.26.x","mime":"1.2.x","nconf":"0.6.x","node-zip":"0.0.x","q":"0.8.x","request":"2.9.x","socket.io":"0.9.x","stylus":"0.27.x","uglify-js":"1.3.x"},"devDependencies":{"mocha":"1.x.x","sandboxed-module":"0.x.x","should":"1.x.x","zombie":"1.x.x"},"scripts":{"test":"mocha --reporter list","test-fetch":"mocha test/test.fetch.js --reporter list","test-minify":"mocha test/test.minify.js --reporter list","test-insert":"mocha test/test.insert.js --reporter list","test-compile":"mocha test/test.compile.js --reporter list","test-serve":"mocha test/test.serve.js --reporter list"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification.\n\nServe: `nodefront serve` - Serve files on localhost. Automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nOutput: `nodefront compile -o/--output [directory]` outputs all compiled files into the given output directory. If not provided, this defaults to the current directory.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n### Configuration Files\nLanguage compilers often come with a variety of options. For example, Jade has the option of compressing HTML upon compilation. Nodefront allows you to set these options via configuration files. To do so, simply create a `.nf` directory anywhere in your project tree. This means that `.nf` can be present directly in your project directory or in any of its parent directories. Then, add a `compile.json` or `compile.yml` file with a `compilerOptions` map. Each key should be a file extension and the value should be a map of options to pass to the compiler for that extension. For example, to tell Jade to output pretty HTML instead of compressing it, you can use the following `.nf/compile.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"jade\": { \n            \"pretty\": true\n        }\n    }\n}\n```\n\nThe YAML equivalent, `.nf/compile.yml`, would look like:\n\n```yml\ncompilerOptions:\n    jade:\n        pretty: true\n```\n\n## Serve Command\n### Usage\n\n```bash\n$ nodefront serve [options] [port] [hostname]\n```\n\nThe serve command will serve all static files in the current directory and subdirectories on a local Node.js server. The current directory will act as the effective root of the server. Files will be accessible by the URL http://[hostname]:[port]/[path], where [path] is the path to the file relative to the current directory. [hostname] and [port] are provided as explicit parameters on the command-line and default to localhost and 3000, respectively.\n\n### Example\nIf the directory structure looks like:\n\n    .\n    |_ index.html\n    |_ css\n      `_ styles.css\n    |_ js\n      `_ script.js\n\nRunning `nodefront serve` in the directory with no options would allow you to access the three files above using the following URLs:\n\nhttp://localhost:3000/index.html would serve ./index.html  \nhttp://localhost:3000/css/styles.css would serve ./css/styles.css  \nhttp://localhost:3000/css/script.js would serve ./js/script.js\n\n### Options\nCompile: `nodefront serve -c/--compile` will run `nodefront compile -w/--watch` simultaneously. This allows you to modify files that need to be compiled and immediately see the updates in your browser.\n\nLive: `nodefront serve -l/--live` will monitor each HTML page that is served to the browser and all of its CSS/JS dependencies. If the page's source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it will be reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of live mode, the server that is created automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows for communication between the client and the Node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@1.0.3","dist":{"shasum":"b41471c5ae5c041cc36f1397a1c08dd24a5049b4","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-1.0.3.tgz","integrity":"sha512-cmc0anuVWd97cW872msncHbZhKnht8sZ5JdL3kdETHjNAHlFEr/q6ua9tuOyvVXlQo5rGoY0gLA8UOVeVukl5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0BVEvCbbbcJ3mgm7ySr1aDjOTvRgba+aFGCyqUZyRvQIgekz3Cr4vsMefSi9NyDOMkyRgrBxFfsN9YJppCcJlxHg="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"1.0.4":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"1.0.4","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"coffee-script":"1.3.x","commander":"1.0.x","commander-config":"0.x.x","consolidate-build":"1.x.x","jade":"0.26.x","mime":"1.2.x","nconf":"0.6.x","node-zip":"0.0.x","q":"0.8.x","request":"2.9.x","socket.io":"0.9.x","stylus":"0.27.x","uglify-js":"1.3.x"},"devDependencies":{"mocha":"1.x.x","sandboxed-module":"0.x.x","should":"1.x.x","zombie":"1.x.x"},"scripts":{"test":"mocha --reporter list","test-fetch":"mocha test/test.fetch.js --reporter list","test-minify":"mocha test/test.minify.js --reporter list","test-insert":"mocha test/test.insert.js --reporter list","test-compile":"mocha test/test.compile.js --reporter list","test-serve":"mocha test/test.serve.js --reporter list"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification.\n\nServe: `nodefront serve` - Serve files on localhost. Automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nOutput: `nodefront compile -o/--output [directory]` outputs all compiled files into the given output directory. If not provided, this defaults to the current directory.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n### Configuration Files\nLanguage compilers often come with a variety of options. For example, Jade has the option of compressing HTML upon compilation. Nodefront allows you to set these options via configuration files. To do so, simply create a `.nf` directory anywhere in your project tree. This means that `.nf` can be present directly in your project directory or in any of its parent directories. Then, add a `compile.json` or `compile.yml` file with a `compilerOptions` map. Each key should be a file extension and the value should be a map of options to pass to the compiler for that extension. For example, to tell Jade to output pretty HTML instead of compressing it, you can use the following `.nf/compile.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"jade\": { \n            \"pretty\": true\n        }\n    }\n}\n```\n\nThe YAML equivalent, `.nf/compile.yml`, would look like:\n\n```yml\ncompilerOptions:\n    jade:\n        pretty: true\n```\n\n## Serve Command\n### Usage\n\n```bash\n$ nodefront serve [options] [port] [hostname]\n```\n\nThe serve command will serve all static files in the current directory and subdirectories on a local Node.js server. The current directory will act as the effective root of the server. Files will be accessible by the URL http://[hostname]:[port]/[path], where [path] is the path to the file relative to the current directory. [hostname] and [port] are provided as explicit parameters on the command-line and default to localhost and 3000, respectively.\n\n### Example\nIf the directory structure looks like:\n\n    .\n    |_ index.html\n    |_ css\n      `_ styles.css\n    |_ js\n      `_ script.js\n\nRunning `nodefront serve` in the directory with no options would allow you to access the three files above using the following URLs:\n\nhttp://localhost:3000/index.html would serve ./index.html  \nhttp://localhost:3000/css/styles.css would serve ./css/styles.css  \nhttp://localhost:3000/css/script.js would serve ./js/script.js\n\n### Options\nCompile: `nodefront serve -c/--compile` will run `nodefront compile -w/--watch` simultaneously. This allows you to modify files that need to be compiled and immediately see the updates in your browser.\n\nOutput: `nodefront serve -o/--output [directory]` should be specified only if the `-c/--compile` option is used. This will output all compiled files into the given output directory specified by [directory]. If not provided, this defaults to the current directory. Note that this is simply done by passing [directory] to the `-o/--output` option of the `nodefront compile` command.\n\nLive: `nodefront serve -l/--live` will monitor each HTML page that is served to the browser and all of its CSS/JS dependencies. If the page's source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it will be reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of live mode, the server that is created automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows for communication between the client and the Node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@1.0.4","dist":{"shasum":"ad6d95edfb73c966fea80f03cff4b5856e2977bb","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-1.0.4.tgz","integrity":"sha512-EOQk+rWePWl8tzS78eu7njJJ01+BzeDkk6e8OFBA8Wup4rHvPQajujKb4sqjA4Ug1+tNYL4plLtJuM1eCQ+8uw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWC9pMqvd8M5f1DPkh/c6QfjD9yH8v1NymUTXxRYOgzQIhANji5xPyK4NRXdia9uwIrQan78Y1M7dl9flPyuG0NRpP"}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"1.0.5":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"1.0.5","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">=0.6.7"},"dependencies":{"coffee-script":"1.3.x","commander":"1.0.x","commander-config":"0.x.x","consolidate-build":"1.x.x","jade":"0.26.x","mime":"1.2.x","nconf":"0.6.x","node-zip":"0.0.x","q":"0.8.10","request":"2.9.x","socket.io":"0.9.x","stylus":"0.27.x","uglify-js":"1.3.x"},"devDependencies":{"mocha":"1.x.x","sandboxed-module":"0.x.x","should":"1.x.x","zombie":"1.x.x"},"scripts":{"test":"mocha --reporter list","test-fetch":"mocha test/test.fetch.js --reporter list","test-minify":"mocha test/test.minify.js --reporter list","test-insert":"mocha test/test.insert.js --reporter list","test-compile":"mocha test/test.compile.js --reporter list","test-serve":"mocha test/test.serve.js --reporter list"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification.\n\nServe: `nodefront serve` - Serve files on localhost. Automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nOutput: `nodefront compile -o/--output [directory]` outputs all compiled files into the given output directory. If not provided, this defaults to the current directory.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n### Configuration Files\nLanguage compilers often come with a variety of options. For example, Jade has the option of compressing HTML upon compilation. Nodefront allows you to set these options via configuration files. To do so, simply create a `.nf` directory anywhere in your project tree. This means that `.nf` can be present directly in your project directory or in any of its parent directories. Then, add a `compile.json` or `compile.yml` file with a `compilerOptions` map. Each key should be a file extension and the value should be a map of options to pass to the compiler for that extension. For example, to tell Jade to output pretty HTML instead of compressing it, you can use the following `.nf/compile.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"jade\": { \n            \"pretty\": true\n        }\n    }\n}\n```\n\nThe YAML equivalent, `.nf/compile.yml`, would look like:\n\n```yml\ncompilerOptions:\n    jade:\n        pretty: true\n```\n\n## Serve Command\n### Usage\n\n```bash\n$ nodefront serve [options] [port] [hostname]\n```\n\nThe serve command will serve all static files in the current directory and subdirectories on a local Node.js server. The current directory will act as the effective root of the server. Files will be accessible by the URL http://[hostname]:[port]/[path], where [path] is the path to the file relative to the current directory. [hostname] and [port] are provided as explicit parameters on the command-line and default to localhost and 3000, respectively.\n\n### Example\nIf the directory structure looks like:\n\n    .\n    |_ index.html\n    |_ css\n      `_ styles.css\n    |_ js\n      `_ script.js\n\nRunning `nodefront serve` in the directory with no options would allow you to access the three files above using the following URLs:\n\nhttp://localhost:3000/index.html would serve ./index.html  \nhttp://localhost:3000/css/styles.css would serve ./css/styles.css  \nhttp://localhost:3000/css/script.js would serve ./js/script.js\n\n### Options\nCompile: `nodefront serve -c/--compile` will run `nodefront compile -w/--watch` simultaneously. This allows you to modify files that need to be compiled and immediately see the updates in your browser.\n\nOutput: `nodefront serve -o/--output [directory]` should be specified only if the `-c/--compile` option is used. This will output all compiled files into the given output directory specified by [directory]. If not provided, this defaults to the current directory. Note that this is simply done by passing [directory] to the `-o/--output` option of the `nodefront compile` command.\n\nLive: `nodefront serve -l/--live` will monitor each HTML page that is served to the browser and all of its CSS/JS dependencies. If the page's source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it will be reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of live mode, the server that is created automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows for communication between the client and the Node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@1.0.5","dist":{"shasum":"00039a0091949ac3ee2f5294fe592cebb0b91159","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-1.0.5.tgz","integrity":"sha512-J2PqOeBtUKevaif+Q4JL7QRc9xRk7V2OPvopkX4c0/7xUa08Ao2qh0dEEqOGgPJpgYMP7PBtmSowkqA7IOLW6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhpOuvWr6gAXdoNEaGUUJRIeD9C2tqVtHbsijdLocihgIgX6GJnSctOCAQay6ws29xOUbSJhqqL65f43fAN1gQv9k="}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"1.0.6":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"1.0.6","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">= 0.6.7"},"dependencies":{"coffee-script":">= 1.3.2","commander":"1.0.x","commander-config":"0.x.x","consolidate-build":"1.x.x","jade":">= 0.26.3","mime":"1.2.x","nconf":"0.6.x","node-zip":"0.0.x","q":"0.8.10","request":"2.9.x","socket.io":"0.9.x","stylus":">= 0.27.2","uglify-js":"1.3.x"},"devDependencies":{"mocha":"1.x.x","sandboxed-module":"0.x.x","should":"1.x.x","zombie":"1.x.x"},"scripts":{"test":"mocha --reporter list","test-fetch":"mocha test/test.fetch.js --reporter list","test-minify":"mocha test/test.minify.js --reporter list","test-insert":"mocha test/test.insert.js --reporter list","test-compile":"mocha test/test.compile.js --reporter list","test-serve":"mocha test/test.serve.js --reporter list"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification.\n\nServe: `nodefront serve` - Serve files on localhost. Automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nOutput: `nodefront compile -o/--output [directory]` outputs all compiled files into the given output directory. If not provided, this defaults to the current directory.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n### Configuration Files\nLanguage compilers often come with a variety of options. For example, Jade has the option of compressing HTML upon compilation. Nodefront allows you to set these options via configuration files. To do so, simply create a `.nf` directory anywhere in your project tree. This means that `.nf` can be present directly in your project directory or in any of its parent directories. Then, add a `compile.json` or `compile.yml` file with a `compilerOptions` map. Each key should be a file extension and the value should be a map of options to pass to the compiler for that extension. For example, to tell Jade to output pretty HTML instead of compressing it, you can use the following `.nf/compile.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"jade\": { \n            \"pretty\": true\n        }\n    }\n}\n```\n\nThe YAML equivalent, `.nf/compile.yml`, would look like:\n\n```yml\ncompilerOptions:\n    jade:\n        pretty: true\n```\n\n## Serve Command\n### Usage\n\n```bash\n$ nodefront serve [options] [port] [hostname]\n```\n\nThe serve command will serve all static files in the current directory and subdirectories on a local Node.js server. The current directory will act as the effective root of the server. Files will be accessible by the URL http://[hostname]:[port]/[path], where [path] is the path to the file relative to the current directory. [hostname] and [port] are provided as explicit parameters on the command-line and default to localhost and 3000, respectively.\n\n### Example\nIf the directory structure looks like:\n\n    .\n    |_ index.html\n    |_ css\n      `_ styles.css\n    |_ js\n      `_ script.js\n\nRunning `nodefront serve` in the directory with no options would allow you to access the three files above using the following URLs:\n\nhttp://localhost:3000/index.html would serve ./index.html  \nhttp://localhost:3000/css/styles.css would serve ./css/styles.css  \nhttp://localhost:3000/css/script.js would serve ./js/script.js\n\n### Options\nCompile: `nodefront serve -c/--compile` will run `nodefront compile -w/--watch` simultaneously. This allows you to modify files that need to be compiled and immediately see the updates in your browser.\n\nOutput: `nodefront serve -o/--output [directory]` should be specified only if the `-c/--compile` option is used. This will output all compiled files into the given output directory specified by [directory]. If not provided, this defaults to the current directory. Note that this is simply done by passing [directory] to the `-o/--output` option of the `nodefront compile` command.\n\nLive: `nodefront serve -l/--live` will monitor each HTML page that is served to the browser and all of its CSS/JS dependencies. If the page's source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it will be reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of live mode, the server that is created automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows for communication between the client and the Node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@1.0.6","dist":{"shasum":"7f1e011e6a57611d7f96e7698ea1c2e52ef0f58a","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-1.0.6.tgz","integrity":"sha512-WB11AYTM6ZCCJwPdaO9Avo5L095jkSWXZrHSyHvTjookA8gh33zPLE3tXLhLzt6Dwg4Uyq8JaQV0ANdV4sA2eQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1qUwLjylr2kP8QbMXMilFrnaAAi3vveTYlHSmzHGfxQIhAIgq97WqwHZqUBDp7JStJ3PYoNc1T72vre+Fo6A6dZD+"}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]},"1.0.7":{"name":"nodefront","description":"To see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront)","author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"version":"1.0.7","homepage":"http://karthikv.github.com/nodefront/","bin":{"nodefront":"./nodefront.js"},"engines":{"node":">= 0.6.7"},"dependencies":{"coffee-script":">= 1.3.2","commander":"1.0.x","commander-config":"0.x.x","consolidate-build":"1.x.x","jade":">= 0.26.3","mime":"1.2.x","nconf":"0.6.x","node-zip":"0.0.x","q":"0.8.10","request":"2.9.x","socket.io":"0.9.x","stylus":">= 0.27.2","uglify-js":"1.3.x"},"devDependencies":{"mocha":"1.x.x","sandboxed-module":"0.x.x","should":"1.x.x","zombie":"1.x.x"},"scripts":{"test":"mocha --reporter list","test-fetch":"mocha test/test.fetch.js --reporter list","test-minify":"mocha test/test.minify.js --reporter list","test-insert":"mocha test/test.insert.js --reporter list","test-compile":"mocha test/test.compile.js --reporter list","test-serve":"mocha test/test.serve.js --reporter list"},"readme":"# Nodefront [![Build Status](https://secure.travis-ci.org/karthikv/nodefront.png)](http://travis-ci.org/karthikv/nodefront)\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node.js-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install -g nodefront\n```\n\n## Upgrading\n\nUpgrading nodefront should be done by reinstalling, like so:\n\n```bash\n$ npm uninstall -g nodefront\n$ npm install -g nodefront\n```\n\nIt is not recommended to use `npm update nodefront` due to a [known bug](https://github.com/isaacs/npm/issues/2390) that prevents it from adding new dependencies correctly.\n\n## Introductory Screencast\n\nBefore diving into the documentation, you may view a [screencast that introduces some of nodefront's key features on Vimeo](https://vimeo.com/46197434).\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles a variety of templating and built languages (see compile command below), including, by default, Jade, Stylus, and CoffeeScript. Can compile upon modification.\n\nServe: `nodefront serve` - Serve files on localhost. Automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command, by default, will look for all Jade (\\*.jade), Stylus (\\*.styl, \\*.stylus), and CoffeeScript (\\*.coffee) files in the current directory without recursing (see the recursive option) and compile them to their HTML, CSS, and JS counterparts, simply replacing the extension of the originally-named file.\n\nThis command, however, is not limited to only these three file types. Because nodefront uses [consolidate-build](https://github.com/ForbesLindesay/consolidate-build), all of the following templating and built languages are supported:\n\n- [coffee-script](https://github.com/jashkenas/coffee-script) - [website](http://coffeescript.org/)\n- [dust](https://github.com/akdubya/dustjs) - [website](http://akdubya.github.com/dustjs/)\n- [eco](https://github.com/sstephenson/eco)\n- [ejs](https://github.com/visionmedia/ejs)\n- [haml](https://github.com/visionmedia/haml.js) - [website](http://haml-lang.com/)\n- [haml-coffee](https://github.com/9elements/haml-coffee) - [website](http://haml-lang.com/)\n- [handlebars](https://github.com/wycats/handlebars.js/) - [website](http://handlebarsjs.com/)\n- [hogan](https://github.com/twitter/hogan.js) - [website](http://twitter.github.com/hogan.js/)\n- [jade](https://github.com/visionmedia/jade) - [website](http://jade-lang.com/)\n- [jazz](https://github.com/shinetech/jazz)\n- [jqtpl](https://github.com/kof/node-jqtpl) - [website](http://api.jquery.com/category/plugins/templates/)\n- [JUST](https://github.com/baryshev/just)\n- [less](https://github.com/cloudhead/less.js) - [website](http://lesscss.org)\n- [liquor](https://github.com/chjj/liquor)\n- [markdown](http://daringfireball.net/projects/markdown/)\n- [mustache](https://github.com/janl/mustache.js)\n- [QEJS](https://github.com/jepso/QEJS)\n- [sass](https://github.com/visionmedia/sass.js) - [website](http://sass-lang.com/)\n- [stylus](https://github.com/learnboost/stylus) - [website](http://learnboost.github.com/stylus/)\n- [swig](https://github.com/paularmstrong/swig) - [website](http://paularmstrong.github.com/swig/)\n- [underscore](https://github.com/documentcloud/underscore) - [website](http://documentcloud.github.com/underscore/)\n- [walrus](https://github.com/jeremyruppel/walrus) - [website](http://documentup.com/jeremyruppel/walrus/)\n- [whiskers](https://github.com/gsf/whiskers.js/tree/)\n\nTo employ any of the above languages other than the three defaults, you'll need to install their respective engines. For example, if you'd like to use ejs, you'll need to run:\n\n```bash\nnpm install -g ejs\n```\n\nFor Markdown specifically, you have the option of installing [marked](https://github.com/chjj/marked), [discount](https://github.com/visionmedia/node-discount), [markdown-js](https://github.com/Gozala/markdown-js) or [markdown](https://github.com/evilstreak/markdown-js). If more than one of these are installed, the first in that list will take precedence.\n\nThen, simply create files with the extension corresponding to the engine you're using (e.g. '.ejs' for ejs files) and nodefront will automatically compile them when you run the compile command.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    |_ styles.styl\n    `_ script.coffee\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html`, `styles.styl` will be compiled to `styles.css`, and `script.coffee` will be compiled to `script.js`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    |_ styles.css\n    |_ script.coffee\n    `_ script.js\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all files that can be compiled in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nOutput: `nodefront compile -o/--output [directory]` outputs all compiled files into the given output directory. If not provided, this defaults to the current directory.\n\n### Markdown Support\nIf you'd like markdown support for Jade, simply install the [marked](https://github.com/chjj/marked) library, like so:\n\n```bash\n$ npm install -g marked\n```\n\nJade should automatically interface with it.\n\n### Configuration Files\nLanguage compilers often come with a variety of options. For example, Jade has the option of compressing HTML upon compilation. Nodefront allows you to set these options via configuration files. To do so, simply create a `.nf` directory anywhere in your project tree. This means that `.nf` can be present directly in your project directory or in any of its parent directories. Then, add a `compile.json` or `compile.yml` file with a `compilerOptions` map. Each key should be a file extension and the value should be a map of options to pass to the compiler for that extension. For example, to tell Jade to output pretty HTML instead of compressing it, you can use the following `.nf/compile.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"jade\": { \n            \"pretty\": true\n        }\n    }\n}\n```\n\nThe YAML equivalent, `.nf/compile.yml`, would look like:\n\n```yml\ncompilerOptions:\n    jade:\n        pretty: true\n```\n\n## Serve Command\n### Usage\n\n```bash\n$ nodefront serve [options] [port] [hostname]\n```\n\nThe serve command will serve all static files in the current directory and subdirectories on a local Node.js server. The current directory will act as the effective root of the server. Files will be accessible by the URL http://[hostname]:[port]/[path], where [path] is the path to the file relative to the current directory. [hostname] and [port] are provided as explicit parameters on the command-line and default to localhost and 3000, respectively.\n\n### Example\nIf the directory structure looks like:\n\n    .\n    |_ index.html\n    |_ css\n      `_ styles.css\n    |_ js\n      `_ script.js\n\nRunning `nodefront serve` in the directory with no options would allow you to access the three files above using the following URLs:\n\nhttp://localhost:3000/index.html would serve ./index.html  \nhttp://localhost:3000/css/styles.css would serve ./css/styles.css  \nhttp://localhost:3000/css/script.js would serve ./js/script.js\n\n### Options\nCompile: `nodefront serve -c/--compile` will run `nodefront compile -w/--watch` simultaneously. This allows you to modify files that need to be compiled and immediately see the updates in your browser.\n\nOutput: `nodefront serve -o/--output [directory]` should be specified only if the `-c/--compile` option is used. This will output all compiled files into the given output directory specified by [directory]. If not provided, this defaults to the current directory. Note that this is simply done by passing [directory] to the `-o/--output` option of the `nodefront compile` command.\n\nLive: `nodefront serve -l/--live` will monitor each HTML page that is served to the browser and all of its CSS/JS dependencies. If the page's source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it will be reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of live mode, the server that is created automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows for communication between the client and the Node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images, like so:\n\n```bash\n$ nodefront minify -cj\n```\n\n## Contributors\n### Karthik Viswanathan - nodefront core developer\n- GitHub: [@karthikv](https://github.com/karthikv)\n- Twitter: [@karthikvnet](https://twitter.com/karthikvnet)\n- Website: [http://karthikv.net](http://karthikv.net)\n- Email: me@karthikv.net\n\n### Forbes Lindesay - [consolidate-build](https://github.com/ForbesLindesay/consolidate-build) core developer\n- GitHub: [@ForbesLindesay](https://github.com/ForbesLindesay)\n- Website: [http://www.jepso.com](http://www.jepso.com)\n\n## Questions?\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact Karthik directly (see contributors section above).\n\n## Inspiration\n- [Volo](https://github.com/volojs/volo) - \"A JavaScript dependency manager and project creation tool that favors GitHub for the package repository.\"\n- [Yeoman](http://yeoman.io/) - \"A robust and opinionated client-side stack, comprised of tools and frameworks that can help developers quickly build beautiful web applications.\"\n\n## License\n(The MIT License)\n\nCopyright (c) 2012 Karthik Viswanathan &lt;me@karthikv.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"nodefront@1.0.7","dist":{"shasum":"ce94908387c3263cafdd1e8e5f4684b1cbc7bfab","tarball":"https://registry.npmjs.org/nodefront/-/nodefront-1.0.7.tgz","integrity":"sha512-HetCfUSvG8asQN92r9bq6I3sqFBib+l6ALaecJieOxKPczkpZm8A9uKSMoGPCZBIRFsgK7WUZJ5ff0HoZl2TZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbmVamKannUaSB6Jx94/8yDndbbKybuEO23wEWgnFyEwIhAN59UvUcu9AcOKp2g1g2BoX9gDjIIx2Qq78Oen2Macg/"}]},"maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}]}},"readme":"# Nodefront\n\nTo see a styled version of the documentation below, please visit [nodefront's website](http://karthikv.github.com/nodefront).\n\n## Overview\n\nNodefront is a node-powered command-line utility that speeds up front-end development.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\nnpm install -g nodefront\n```\n\n## Command Summary\n\nCompile: `nodefront compile` - Compiles Jade and Stylus files to HTML and CSS. Can compile upon modification, serve files on localhost, and even automatically refresh the browser/styles when files are changed.\n\nFetch: `nodefront fetch` - Automatically fetches CSS/JS libraries for use in your project. Provides an interactive mode to add new libraries.\n\nInsert: `nodefront insert` - Inserts CSS/JS libraries directly into your HTML or Jade files.\n\nMinify: `nodefront minify` - Minifies CSS and JS files. Can also optimize JPG and PNG images.\n\n## Compile Command\n### Usage\n\n```bash\n$ nodefront compile [options]\n```\n\nThe compile command will look for all Jade (\\*.jade) and Stylus (\\*.styl, \\*.stylus) files in the current directory without recursing (see the recursive option) and compile them to their HTML and CSS counterparts, simply replacing the extension of the originally-named file.\n\n### Example\nIf the directory structure initially looks like:\n\n    .\n    |_ index.jade\n    `_ styles.styl\n\nAfter running `nodefront compile`, `index.jade` will be compiled to `index.html` and `styles.styl` will be compiled to `styles.css`, resulting in the following new directory structure:\n\n    .\n    |_ index.jade\n    |_ index.html\n    |_ styles.styl\n    `_ styles.css\n\n### Options\nHelp: `nodefront compile -h/--help` outputs usage information about the compile command.\n\nRecursive: `nodefront compile -r/--recursive` recurses through sub-directories instead of only compiling Jade and Stylus files in the current directory.\n\nWatch: `nodefront compile -w/--watch` watches all Jade and Stylus files in the current directory (and subdirectories if the recursive option is specified) and recompiles them upon modification. `watch` is dependency aware, meaning that if `index.jade` extends/includes `layout.jade`, when `layout.jade` is modified, both `layout.jade` and `index.jade` will be recompiled. This same awareness is present for Stylus files as well.\n\nServe: `nodefront compile -s/--serve [port]` creates a `localhost` server via node.js that serves all files in the current directory and any subdirectories. By default, this server is created on port 3000, but this is modifiable via the [port] option. For example, `nodefront --serve 5387` will serve nodefront on port 5387.\n\nLive: `nodefront compile -l/--live [port]` mimics the serve option (see above) with some added file watching features. For each HTML page that is served to the browser, all of its file dependencies, including the source itself, its CSS styles, and its scripts, are monitored for changes. If the source itself or one of its scripts changes, the browser will automatically refresh. If a CSS stylesheet is modified, it is reloaded without refreshing via a cache-busting query string. This allows for live development with immediate feedback and circumvents the need to keep reloading the browser manually.\n\nFor those who are interested in the more technical aspects of the live command, the `localhost` server that it creates automatically injects web socket code, courtesy of socket.io, into HTML pages. This allows communication between the client and the node.js server. Whenever a file is modified, the server notifies the client via the established socket connection. The client then assesses whether this file affects the current page and takes appropriate actions.\n\n## Fetch Command\n### Usage\n\n```bash\n$ nodefront fetch [library] [options]\n```\n\nThe fetch command will download the given CSS/JS library, [library], from the web and add it to the current directory. Nodefront is already aware of many of the most popular CSS/JS libraries, but can easily be configured to fetch lesser-known ones.\n\n### Example\nTo fetch the latest version of jQuery, simply run:\n\n```bash\n$ nodefront fetch jquery\n```\n\njQuery 1.7.2 (as of 6/19/12) will then be added to the current directory. If, for instance, you'd like to fetch version 1.5, simply use the version option, specified by `-v` or `--version`:\n\n```bash\n$ nodefront fetch jquery -v 1.5\n```\n\njQuery 1.5 should then be downloaded into the current directory.\n\n### Options\nHelp: `nodefront fetch -h/--help` outputs usage information about the compile command.\n\nType: `nodefront fetch [library] -t/--type [type]` will set the type, or extension, of the given library, [library]. When the library has finished downloading, it will then be named [library]-[version].\\[type\\]. Note that the type defaults to js if this option is not given.\n\nOutput: `nodefront fetch [library] -o/--output [directory]` downloads the given library and stores the resultant file (see type option above), in the given directory, [directory].\n\nVersion: `nodefront fetch [library] -v/--version [version]` downloads the given library at the provided version number, [version], and saves it to [library]-[version].\\[type\\] (see type option above).\n\nInteractive: `nodefront fetch [library] -i/--interactive` enables interactive mode, where you'll be provided with numerous dialogs that fully explain the process of adding a new library. You can alternatively specify all the configuration parameters necessary by using the command-line (see options below). Note that, if necessary, you can mix and match as well, specifying the URL parameter while also going into interactive mode to get some help setting the path.\n\nURL: `nodefront fetch [library] -u/--url [url]` will fetch the library file at the given URL, [url], and add it to the current directory with the name [library]-[version].\\[type\\] (see version/type options above). To make this flexible for different versions of the library, simply add the parameter `{{ version }}` where the version should be inserted in the URL. Then, the version parameter (see above) will determine what value this gets replaced with. Note that, if you specify the URL for a library, all configuration options are automatically saved, meaning that you can fetch the library again at any time simply by running `nodefront fetch [library]`. If you ever need to update the configuration options again, specify the URL once more.\n\nPath: `nodefront fetch [library] -p/--path [pathRegex]` requires the URL parameter to be provided (see above). It then assumes that the [url] points to a zip file, extracts all files within it, and finds the first one to match the regular expression [pathRegex]. This file will be considered the library you were looking for and is then downloaded.\n\nMinify: `nodefront fetch [library] -m/--minify` will fetch the given library and minify it upon download. Note that both CSS and JS libraries can be minified.\n\n## Insert Command\n### Usage\n\n```bash\n$ nodefront insert [libraryPath] [file] [options]\n```\n\nThe insert command will insert the CSS or JS library, given by the path [libraryPath], into the HTML or Jade file specified by [file] as either a link or script tag. If [libraryPath] ends in '.css', a link tag will be appended to the head of the document. In like manner, if [libraryPath] ends in '.js', a script tag will be inserted in the footer prior to the end of the body (see head option for inserting into the head).\n\n### Examples\nTo insert a script tag containing jquery at the end of index.html, run:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html\n```\n\nIf, instead, you would like the script tag to be appended to the head tag, simply specify the head option, specified by `-h` or `--head`:\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -h\n```\n\nBoth of these will insert the tag `<script src=\"jquery-1.7.2.js\"></script>` into index.html. For jade files, nodefront will insert `script(src='jquery-1.7.2.js')` instead. Note that nodefront will find the relative path between [libraryPath] and [file] and use that as the src attribute. If you would like an absolute path instead, use the absolute option, specified by `-a` or `--absolute`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -a\n```\n\nTo remove `jquery-1.7.2.js` from a file, add the delete option, specified by `-d` or `--delete`.\n\n```bash\n$ nodefront insert jquery-1.7.2.js index.html -ad\n```\n\nMake sure to maintain the absolute option if the original insertion used an absolute path.\n\n### Options\nHelp: `nodefront insert --help` outputs usage information about the insert command.\n\nHead: `nodefront insert [libraryPath] [file] -h/--head` will append the given library to the head of the document. By default, CSS libraries are added to the head, as they cannot be added elsewhere, and JS libraries are added prior to the end body tag.\n\nAbsolute: `nodefront insert [libraryPath] [file] -a/--absolute` will use the absolute path of the given library, [libraryPath], as the value of the src/href attribute to the script/link tag that is inserted. By default, a relative path is used.\n\nTab Length: `nodefront insert [libraryPath] [file] -t/--tab-length [length]` will use the provided tab length, [length], when inserting the script/link tag. By default, the tab length is 4, representing four spaces. If you would prefer hard tabs (`'\\t'` characters), simply specify -1 as the tab length.\n\nDelete: `nodefront insert [libraryPath] [file] -d` will delete the library from the given file instead of inserting it. Make sure to maintain the absolute option (see above) if the original insertion used an absolute path for the src/href attribute.\n\n## Minify Command\n### Usage\n\n```bash\n$ nodefront minify [fileRegex] [options]\n```\n\nThe minify command finds all file paths in the current directory, without recursing (see the recursive option), that match the given fileRegex. It then minifies the corresponding files, using UglifyJS for JS files, YUI (the JS implementation) for CSS, JPEGtran for JPEG, and OptiPNG for PNG. By default, the output file name is the original file name without its extension followed by '.min.' and the original file name's extension. For example, if the original file name is 'style.css', the new file name is 'style.min.css'.\n\n### Examples\nTo minify script.js in the current directory into script.min.js, run:\n\n```bash\n$ nodefront minify -p script.js\n```\n\nThe plain option, specified by `-p` or `--plain`, changes [fileRegex] from a regular expression to just a plain text string.\n\nTo minify all CSS files in the current directory, simply use the CSS option, `-c` or `-css` with no [fileRegex] parameter:\n\n```bash\n$ nodefront minify -c\n```\n\nIn like manner, the JS option, `-j` or  `--js`, and the images option, `-i` or `--images`, minify JS files and optimize all images, respectively. You can mix and match these options as necessary. To minify all CSS, JS, and image files in the current directory, for example, run:\n\n```bash\n$ nodefront minify -cji\n```\n\n### Options\nHelp: `nodefront minify --help` outputs usage information about the minify command.\n\nRecursive: `nodefront minify [fileRegex] -r/--recursive` will minify all file paths in the current directory and in any sub-directories that match the regular expression [fileRegex].\n\nPlain: `nodefront minify [fileRegex] -p/--plain` will change [fileRegex] from being a regular expression to just a normal text string. With this option enabled, you can pinpoint the exact file you would like to minify by setting [fileRegex] to its path.\n\nType: `nodefront minify [fileRegex] -t/--type [type]` will set the type of all the files that are being minified. Normally, the type of a given file is determined by its extension, with \\*.css, \\*.js, \\*.png, and \\*.jpg or \\*.jpeg representing CSS, JS, PNG, and JPEG files, respectively. If you would like to minify a file without an extension or with one that does not match these defaults, this option will let you force nodefront to treat it as if it had the extension [type]. For example, running `nodefront minify -p script -t js` would minify script as if it was a JS file even though it lacks a .js extension.\n\nOut: `nodefront minify [fileRegex] -o [file]` will minify all file paths in the current directory that match the regular expression [fileRegex] and put the output in the file named [file]. Include `{{ name }}` in [file] and it will be replaced by the name of the current file being minified without its extension. In like manner, include `{{ extension }}` in [file] and it will be replaced by the extension of the current file being minified. For example, assume you have the following directory structure:\n\n    .\n    |_ main-script.js\n    `_ main-style.css\n\nIf you run `nodefront minify main -o '{{ name }}-minified.{{ extension }}'`, main-script.js will be minified to main-script-minified.js and main-style.css will be minified to main-style-minified.css, leaving you with the following new directory structure:\n\n    .\n    |_ main-script.js\n    |_ main-script-minified.js\n    |_ main-style.css\n    `_ main-style-minified.js\n\nThis option defaults to `{{ name }}.min.{{ extension }}` if not provided.\n\nOverwrite: `nodefront minify [fileRegex] -w/--overwrite` will overwrite files will their minified versions instead of writing to `{{ name }}.min.{{ extension }}` (see out option). This is a shortcut to specifying `{{ name }}.{{ extension }}` for the out option.\n\nCSS: `nodefront minify -c/-css` will minify all CSS files in the current directory. This is a shortcut to `nodefront minify \\.css$`.\n\nJS: `nodefront minify -j/-js` will minify all JS files in the current directory. This is a shortcut to `nodefront minify \\.js$`.\n\nImages: `nodefront minify --i/--images` will minify all JPEG and PNG images in the current directory. This is a shortcut to `nodefront minify \\.(jpg|jpeg|png)$`.\n\nNote that the last three options can be mix and matched as necessary to, for example, minify all CSS and JS, but no images.\n\nIf you have any questions, comments, concerns, or suggestions, please feel free to create a new issue on [GitHub](https://github.com/karthikv/nodefront/issues) or contact me via email at me [at] karthikv [dot] net.\n","maintainers":[{"name":"karthikv","email":"karthik.ksv@gmail.com"}],"time":{"modified":"2022-06-22T02:05:48.222Z","created":"2012-07-20T02:27:51.922Z","0.0.1":"2012-07-20T02:27:53.634Z","0.0.2":"2012-07-23T00:56:08.160Z","0.0.3":"2012-08-05T07:13:23.979Z","0.0.4":"2012-08-09T03:03:16.706Z","0.0.5":"2012-08-10T02:57:10.520Z","0.0.6":"2012-08-12T00:13:43.248Z","0.0.7":"2012-08-15T03:22:11.256Z","0.0.8":"2012-08-16T06:48:09.474Z","0.1.0":"2012-08-17T18:20:52.509Z","0.1.1":"2012-08-20T01:14:26.271Z","1.0.0":"2012-10-05T03:57:13.271Z","1.0.1":"2012-10-23T02:52:34.432Z","1.0.2":"2012-11-06T22:05:25.796Z","1.0.3":"2012-11-10T03:46:47.316Z","1.0.4":"2012-11-24T02:32:21.320Z","1.0.5":"2012-12-22T22:23:42.942Z","1.0.6":"2012-12-27T01:35:29.775Z","1.0.7":"2013-01-19T07:40:37.037Z"},"author":{"name":"Karthik Viswanathan","email":"me@karthikv.net"},"users":{"fgribreau":true}}