{"_id":"pathfinder","_rev":"17-cf808df71bafc3aeb1cce0b76580e8ee","name":"pathfinder","description":"Asset API for Node.js","dist-tags":{"latest":"0.3.0-1"},"versions":{"0.0.1":{"name":"pathfinder","version":"0.0.1","description":"Asset API for Node.js","homepage":"http://github.com/viatropos/pathfinder.js","main":"lib/pathfinder.js","keywords":["framework","node"],"bugs":{"url":"https://github.com/viatropos/pathfinder.js/issues"},"repository":{"type":"git","url":"git://github.com/viatropos/pathfinder.js.git"},"engines":{"node":">= 0.4.0"},"dependencies":{},"_npmUser":{"name":"viatropos","email":"lancejpollard@gmail.com"},"_id":"pathfinder@0.0.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.94","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"26472cbd838a00d53c4dbd2e1354bd6fed4abb50","tarball":"https://registry.npmjs.org/pathfinder/-/pathfinder-0.0.1.tgz","integrity":"sha512-quY/lrLlymOPYAsQ9SfG9SSFkqCUNASXgw7gLSP3Au/vTSUnzzyrw0BffO9SBSxr4PILtWMq4aJgdlpbr5Sd6Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAljCg4E68BsXS1k6rQ46hbaxtCP/cg4DIlPkLg/IHLwIgJHkV/BsmSso9ZIEEbzixRkASXgiFImNstiZCKYCjh+U="}]},"maintainers":[{"name":"viatropos","email":"lancejpollard@gmail.com"}]},"0.1.5":{"name":"pathfinder","version":"0.1.5","description":"Asset API for Node.js","homepage":"http://github.com/viatropos/pathfinder.js","main":"lib/pathfinder.js","author":{"name":"Lance Pollard","email":"lancejpollard@gmail.com"},"maintainers":[{"name":"viatropos","email":"lancejpollard@gmail.com"}],"contributors":[],"keywords":["framework","node"],"bugs":{"url":"https://github.com/viatropos/pathfinder.js/issues"},"repository":{"type":"git","url":"git://github.com/viatropos/pathfinder.js.git"},"engines":{"node":">= 0.4.0"},"dependencies":{"async":">= 0.1.12","mime":">= 1.2.4","detective":">= 0.0.3","findit":">= 0.1.1","mkdirp":">= 0.1.0","shift":">= 0.1.5"},"devDependencies":{"coffee-script":">= 1.1.3","jasmine-node":">= 1.0.12"},"_npmUser":{"name":"viatropos","email":"lancejpollard@gmail.com"},"_id":"pathfinder@0.1.5","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"71156b8d02cc18b19199ce959f01d38078ac4a6c","tarball":"https://registry.npmjs.org/pathfinder/-/pathfinder-0.1.5.tgz","integrity":"sha512-9ggeWteKgeoH8khXvggMpb8G/u4zlFGWkXqjpcI7BUlJXiyd0wMldqQ4vQPUAm9CaxbB07R5LovpPXFpZOR58A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFiA99jDUDqGZ8OpGrGNqAeKz6FCdzjzfbZaMwh/QwUKAiEA0l/YDGjWTHk9oBJYvMbwQQEqrRwFcDWU6DPI1GqKmJA="}]}},"0.1.6":{"name":"pathfinder","version":"0.1.6","description":"Asset API for Node.js","homepage":"http://github.com/viatropos/pathfinder.js","main":"lib/pathfinder.js","author":{"name":"Lance Pollard","email":"lancejpollard@gmail.com"},"maintainers":[{"name":"viatropos","email":"lancejpollard@gmail.com"}],"contributors":[],"keywords":["framework","node"],"bugs":{"url":"https://github.com/viatropos/pathfinder.js/issues"},"repository":{"type":"git","url":"git://github.com/viatropos/pathfinder.js.git"},"engines":{"node":">= 0.4.0"},"dependencies":{"async":">= 0.1.12","mime":">= 1.2.4","detective":">= 0.0.3","findit":">= 0.1.1","mkdirp":">= 0.1.0","shift":">= 0.1.8"},"devDependencies":{"coffee-script":">= 1.1.3","jasmine-node":">= 1.0.12"},"_npmUser":{"name":"viatropos","email":"lancejpollard@gmail.com"},"_id":"pathfinder@0.1.6","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"ddcef3d35093bd1c3933cee26db36ce33e5d2612","tarball":"https://registry.npmjs.org/pathfinder/-/pathfinder-0.1.6.tgz","integrity":"sha512-meAJ14QUuXgaL2xv7f4bqoqgLfw2nZkhjn9LdtIMu6sqh49EibI27Tee9+U3veked5RY5I6WlqJJP6JdOy4l4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDncvTLn0HevaC3GSdBiV3Tqtdkj1dQRbVIyYAM/mjD6QIgGCDISZJQ4RuEwKE7NT7pbtNUp07ZYplG7HEgddmkxlE="}]}},"0.1.7":{"name":"pathfinder","version":"0.1.7","description":"Asset API for Node.js","homepage":"http://github.com/viatropos/pathfinder.js","main":"lib/pathfinder.js","author":{"name":"Lance Pollard","email":"lancejpollard@gmail.com"},"maintainers":[{"name":"viatropos","email":"lancejpollard@gmail.com"}],"contributors":[],"keywords":["framework","node"],"bugs":{"url":"https://github.com/viatropos/pathfinder.js/issues"},"repository":{"type":"git","url":"git://github.com/viatropos/pathfinder.js.git"},"engines":{"node":">= 0.4.0"},"dependencies":{"async":">= 0.1.12","mime":">= 1.2.4","detective":">= 0.0.3","findit":">= 0.1.1","mkdirp":">= 0.1.0","shift":">= 0.1.8"},"devDependencies":{"coffee-script":">= 1.1.3","jasmine-node":">= 1.0.12"},"_npmUser":{"name":"viatropos","email":"lancejpollard@gmail.com"},"_id":"pathfinder@0.1.7","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"8838b7694c04793dd787b5918929bbdc1639c588","tarball":"https://registry.npmjs.org/pathfinder/-/pathfinder-0.1.7.tgz","integrity":"sha512-JW5zdRGin7Tet57XkpyqQFqM+qWhxHmmQdRdlcYm3YFxw78bBe8bZaJqDl9c0fO3ZOzvTyfSvlBxX2DkFgr8Ig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCQZXvKK3sg1wESm1b2lwtehnpv01xJQJaZu/AlI9kaQIgGELwOo19fhS6PVFPYQfoz6ga8nykmbzbNDDeDn9UYe8="}]}},"0.1.9":{"name":"pathfinder","version":"0.1.9","description":"Asset API for Node.js","homepage":"http://github.com/viatropos/pathfinder.js","main":"lib/pathfinder.js","author":{"name":"Lance Pollard","email":"lancejpollard@gmail.com"},"maintainers":[{"name":"viatropos","email":"lancejpollard@gmail.com"}],"contributors":[],"keywords":["framework","node"],"bugs":{"url":"https://github.com/viatropos/pathfinder.js/issues"},"repository":{"type":"git","url":"git://github.com/viatropos/pathfinder.js.git"},"engines":{"node":">= 0.4.0"},"dependencies":{"async":">= 0.1.12","mime":">= 1.2.4","detective":">= 0.0.3","findit":">= 0.1.1","mkdirp":">= 0.1.0","shift":">= 0.1.8"},"devDependencies":{"coffee-script":">= 1.1.3","jasmine-node":">= 1.0.12"},"_npmUser":{"name":"viatropos","email":"lancejpollard@gmail.com"},"_id":"pathfinder@0.1.9","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"da21d64defa51465fe78ab01b20a7761127ce0d8","tarball":"https://registry.npmjs.org/pathfinder/-/pathfinder-0.1.9.tgz","integrity":"sha512-8tdhdflnyHnYnNLkdGOLp7SocpwPTGgxexHFk2HZgxD0xUvnWRSHIi2lHhYzaJGvpPUzYB0UqXKbkGoI7aUAng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRH452Yq8dssdV13fYlvbKFhP+4p/YmdRv3eed0oShTwIgG99HgkckfmLJBl4bAW4Vo8CF0fEw5WLOwO3Abx4lXzs="}]}},"0.3.0":{"name":"pathfinder","version":"0.3.0","description":"Asset API for Node.js","homepage":"http://github.com/viatropos/pathfinder.js","main":"lib/pathfinder.js","author":{"name":"Lance Pollard","email":"lancejpollard@gmail.com"},"maintainers":[{"name":"viatropos","email":"lancejpollard@gmail.com"}],"contributors":[],"keywords":["framework","node"],"bugs":{"url":"https://github.com/viatropos/pathfinder.js/issues"},"repository":{"type":"git","url":"git://github.com/viatropos/pathfinder.js.git"},"engines":{"node":">= 0.4.0"},"dependencies":{"async":">= 0.1.12","mime":">= 1.2.4","detective":">= 0.0.3","findit":">= 0.1.2","mkdirp":">= 0.1.0","mint":">= 0.3.0"},"devDependencies":{},"_npmUser":{"name":"viatropos","email":"lancejpollard@gmail.com"},"_id":"pathfinder@0.3.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"c7b3c03d0c0d0fe53da0965b28e6281fdd4af2c9","tarball":"https://registry.npmjs.org/pathfinder/-/pathfinder-0.3.0.tgz","integrity":"sha512-YFOREiOrdbowg0KoXQx2DyZzOZgGY/WWMMfdctJTLfAPZgo7nAS8fTVpzGQZGS1llYOPasptV9gW4X6p2iQ/Zg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBFZvLsT0paspU7Os2c5AhykgAcZUaFlg0kMtOY1B87AiBq+oK1LlEkqDvcihcijyPfmekGbLhVPX1DWnGoCLKXHw=="}]},"readme":"# Pathfinder.js\n\n> Code for the File Ninja\n\n## Install\n\n```\nnpm install pathfinder\n```\n\n## Goals\n\n- make it so any node.js code works in the browser\n- make it easy to piece together code from modules without `require` (copy the code from one place to another)\n- compile out asset digests\n- make it easy to wrap any code in `require` for the browser\n- be a foundation for any rich watching functionality\n- cache requirements globally, so there's just a list.  makes things much faster\n- `global ||= window` in browser\n\n## API\n\n### Require\n\nHere's what it outputs\n\n``` javascript\nrequire.define(\"/myModule/file.js\", function(require, module, exports, __dirname, __filename) {\n  // your module code\n});\n```\n\nThen when you call `require('./anotherFile.js');`, it knows that the path of this file is `/myModule/file.js`, so it knows that must be `/myModule/anotherFile.js`.\n\nFor things like jQuery, if you only need it in the browser, you can just assume it's a global variable.\n\nIf you want to have it be required, you can do this:\n\n``` javascript\nrequire.define(\"/jquery.js\", function(require, module, exports, __dirname, __filename) {\n  return module.exports = exports.$ = $;\n});\n```\n\nThat makes it so you can still take advantage of things like Google's CDN.\n\nFor browser-only libraries, you're free to manually write the require statements:\n\n``` coffeescript\nrequire.define '/jquery.js', (require, module, exports) ->\n  module.exports = exports.$ = $\n\nrequire.define '/jquery.form.js', (require, module, exports) ->\n  module.exports = exports.$ = $\n```\n\nIf you want to be able to use it in node (forgetting about the fact that jQuery requires some sort of dom), you actually have to wrap the code in this method.  You can do that by downloading the library into your project and generating the output like this:\n\n``` coffeescript\n# ./jquery.coffee\n\n# @include './vendor/jquery.1.7.0.js'\nmodule.exports = $\n```\n\nThen when you compile it, it will import the jquery source code, and wrap it in the define block!\n\n``` javascript\nrequire.define(\"/jquery.js\", function(require, module, exports, __dirname, __filename) {\n  // all the jquery 1.7.0 code...\n  \n  module.exports = $;\n});\n```\n\n### Notes\n\n- For javascripts that will [realistically] only be used in the browser (jquery and plugins), you don't really need to wrap them into define blocks; assume they're global variables like you normally would.\n- For javascripts that will be used in both places and are built to work in both places (e.g. underscore, backbone), it is better to use the node.js version and compile that into a define block.  This way you're only using one version which makes debugging easier to handle.  At some point though I want to make it easy to piggyback off CDN's, which would mean the node.js version needs to be loaded from the CDN.  That's a ways away though.  This means that you shouldn't use them as global variables, even if they allow you to use them like that, because your code will fail in node.js.  You need to `require('backbone')` for example, in any of your client side code that will also be used server side.  Unless you're not going to be using your code as a library, in which case it doesn't really matter.  In that case, just create an `index.js` file or something that sets all the global variables for node like you use them in the browser, i.e. `global.Backbone = require('backbone'); global._ = require('underscore');`.  This also makes it so you don't have to wrap them in require blocks for your app code.\n- For javascripts that need to be used in both places but are built only for the browser, then you have to manually write the define block.  These are usually new/small projects.  You just need to specify what the exports are.  I don't like the idea of creating a github project for each one of these, just create a gist, or post on the wiki here how you did it.  At some point the author should include it in their project.\n- For javascripts that are only built as node.js modules, this will work fine.\n- If you have to create a wrapper for the library, either the author didn't build their framework well enough, or you're using the code for something it wasn't meant for.  As a library author, you can write your own build task that replaces the `require` statements in your node code with the actual code, which outputs as your client version of the file.  This is basically what jade does to give you jade in the browser.\n\n### Directives\n\nJavaScript and CSS files can have two types of directives: `@import` and `@include`.\n\nFiles referenced with the `@import` directive will be directly copied into the location of the directive.\n\nFiles referenced with the `@include` directive will be compiled into either JavaScript or CSS (from CoffeeScript, Stylus, etc.) and then copied into the location of the directive.  That's the only difference from the `@import` directive.\n\nFor instance\n\n``` javascript\n// @import './models'\n// @import './views'\n// @import './controllers'\n\nalert \"application\"\n```\n\nmight become this CoffeeScript\n\n``` javascript\nalert \"models\"\nalert \"views\"\nalert \"controllers\"\n\nalert \"application\"\n```\n\nwhich is then rendered to JavaScript\n\n``` javascript\nalert(\"models\");\nalert(\"views\");\nalert(\"controllers\");\n\nalert(\"application\");\n```\n\n## Paths\n\nPaths work just like they do in Node.js:\n\n- `./relative/path`: relative paths are relative to the current file\n- `/absolute/path`: absolute paths are relative to the current project\n- `library`: libraries are keys\n\n### Compile\n\n``` javascript\nPathfinder  = require 'pathfinder'\npathfinder  = new Pathfinder(root: process.cwd())\n    \npathfinder.compile (file, string) ->\n  console.log string\n  \npathfinder.requirements()\n```\n\n### Write to file\n\n``` javascript\noutputPath = (file) ->\n  relativePath = file.relativePath()\n  if relativePath.match(/^app\\/javascripts\\/(.*)/)\n    \"public/#{RegExp.$1}\"\n  else\n    \"public/#{relativePath}\"\n    \npathfinder.write outputPath: outputPath, (file, string) ->\n  console.log(\"Done!\") unless file\n```\n\n### Find the first file from an ambiguous source\n\n``` javascript\nfile = pathfinder.find \"application\"\n```\n\n### Update with a Watcher\n\nPathfinder.js doesn't include a watcher, but it's setup to be easy to use with one.  It's used in Design.io for example.\n\n``` javascript\nwatch /\\.(js|coffee)/\n  update: (file) ->\n    file.dirname()\n```\n\n### Compile `require` libraries for the browser\n\n``` javascript\npatfinder.writeRequirements()\n```\n\n### Manifests and Digests\n\nOutputs a JSON map of key to compressed, digest version of a file!\n\n## License\n\n(The MIT License)\n\nCopyright &copy; 2011 [Lance Pollard](http://twitter.com/viatropos) &lt;lancejpollard@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},"0.3.0-1":{"name":"pathfinder","version":"0.3.0-1","description":"Asset API for Node.js","homepage":"http://github.com/viatropos/pathfinder.js","main":"lib/pathfinder.js","author":{"name":"Lance Pollard","email":"lancejpollard@gmail.com"},"maintainers":[{"name":"viatropos","email":"lancejpollard@gmail.com"}],"contributors":[],"keywords":["framework","node"],"bugs":{"url":"https://github.com/viatropos/pathfinder.js/issues"},"repository":{"type":"git","url":"git://github.com/viatropos/pathfinder.js.git"},"engines":{"node":">= 0.4.0"},"dependencies":{"async":">= 0.1.12","mime":">= 1.2.4","detective":">= 0.0.3","findit":">= 0.1.2","mkdirp":">= 0.1.0","mint":">= 0.3.0"},"devDependencies":{},"_npmUser":{"name":"viatropos","email":"lancejpollard@gmail.com"},"_id":"pathfinder@0.3.0-1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"3c63ba40c24154095fb46334d5ca6b4b45d8e9cf","tarball":"https://registry.npmjs.org/pathfinder/-/pathfinder-0.3.0-1.tgz","integrity":"sha512-qtky7dOICvCRjf5y+Gjf01yoNZ1TPtM4u5j1TIeeulEsXsJuo6HLfKXyw0ObRJREoNTUm9+K1UQjn5Tk7rw5gA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXjznQMwjjWuEGa2s0tjcZk5zBDNU8a3D31HwIhV8k/wIhAPgVvAlXWC1NJoSPJltKLoP0q3ECRms6sRpnK/Gr05vZ"}]},"readme":"# Pathfinder.js\n\n> Code for the File Ninja\n\n## Install\n\n```\nnpm install pathfinder\n```\n\n## Goals\n\n- make it so any node.js code works in the browser\n- make it easy to piece together code from modules without `require` (copy the code from one place to another)\n- compile out asset digests\n- make it easy to wrap any code in `require` for the browser\n- be a foundation for any rich watching functionality\n- cache requirements globally, so there's just a list.  makes things much faster\n- `global ||= window` in browser\n\n## API\n\n### Require\n\nHere's what it outputs\n\n``` javascript\nrequire.define(\"/myModule/file.js\", function(require, module, exports, __dirname, __filename) {\n  // your module code\n});\n```\n\nThen when you call `require('./anotherFile.js');`, it knows that the path of this file is `/myModule/file.js`, so it knows that must be `/myModule/anotherFile.js`.\n\nFor things like jQuery, if you only need it in the browser, you can just assume it's a global variable.\n\nIf you want to have it be required, you can do this:\n\n``` javascript\nrequire.define(\"/jquery.js\", function(require, module, exports, __dirname, __filename) {\n  return module.exports = exports.$ = $;\n});\n```\n\nThat makes it so you can still take advantage of things like Google's CDN.\n\nFor browser-only libraries, you're free to manually write the require statements:\n\n``` coffeescript\nrequire.define '/jquery.js', (require, module, exports) ->\n  module.exports = exports.$ = $\n\nrequire.define '/jquery.form.js', (require, module, exports) ->\n  module.exports = exports.$ = $\n```\n\nIf you want to be able to use it in node (forgetting about the fact that jQuery requires some sort of dom), you actually have to wrap the code in this method.  You can do that by downloading the library into your project and generating the output like this:\n\n``` coffeescript\n# ./jquery.coffee\n\n# @include './vendor/jquery.1.7.0.js'\nmodule.exports = $\n```\n\nThen when you compile it, it will import the jquery source code, and wrap it in the define block!\n\n``` javascript\nrequire.define(\"/jquery.js\", function(require, module, exports, __dirname, __filename) {\n  // all the jquery 1.7.0 code...\n  \n  module.exports = $;\n});\n```\n\n### Notes\n\n- For javascripts that will [realistically] only be used in the browser (jquery and plugins), you don't really need to wrap them into define blocks; assume they're global variables like you normally would.\n- For javascripts that will be used in both places and are built to work in both places (e.g. underscore, backbone), it is better to use the node.js version and compile that into a define block.  This way you're only using one version which makes debugging easier to handle.  At some point though I want to make it easy to piggyback off CDN's, which would mean the node.js version needs to be loaded from the CDN.  That's a ways away though.  This means that you shouldn't use them as global variables, even if they allow you to use them like that, because your code will fail in node.js.  You need to `require('backbone')` for example, in any of your client side code that will also be used server side.  Unless you're not going to be using your code as a library, in which case it doesn't really matter.  In that case, just create an `index.js` file or something that sets all the global variables for node like you use them in the browser, i.e. `global.Backbone = require('backbone'); global._ = require('underscore');`.  This also makes it so you don't have to wrap them in require blocks for your app code.\n- For javascripts that need to be used in both places but are built only for the browser, then you have to manually write the define block.  These are usually new/small projects.  You just need to specify what the exports are.  I don't like the idea of creating a github project for each one of these, just create a gist, or post on the wiki here how you did it.  At some point the author should include it in their project.\n- For javascripts that are only built as node.js modules, this will work fine.\n- If you have to create a wrapper for the library, either the author didn't build their framework well enough, or you're using the code for something it wasn't meant for.  As a library author, you can write your own build task that replaces the `require` statements in your node code with the actual code, which outputs as your client version of the file.  This is basically what jade does to give you jade in the browser.\n\n### Directives\n\nJavaScript and CSS files can have two types of directives: `@import` and `@include`.\n\nFiles referenced with the `@import` directive will be directly copied into the location of the directive.\n\nFiles referenced with the `@include` directive will be compiled into either JavaScript or CSS (from CoffeeScript, Stylus, etc.) and then copied into the location of the directive.  That's the only difference from the `@import` directive.\n\nFor instance\n\n``` javascript\n// @import './models'\n// @import './views'\n// @import './controllers'\n\nalert \"application\"\n```\n\nmight become this CoffeeScript\n\n``` javascript\nalert \"models\"\nalert \"views\"\nalert \"controllers\"\n\nalert \"application\"\n```\n\nwhich is then rendered to JavaScript\n\n``` javascript\nalert(\"models\");\nalert(\"views\");\nalert(\"controllers\");\n\nalert(\"application\");\n```\n\n## Paths\n\nPaths work just like they do in Node.js:\n\n- `./relative/path`: relative paths are relative to the current file\n- `/absolute/path`: absolute paths are relative to the current project\n- `library`: libraries are keys\n\n### Compile\n\n``` javascript\nPathfinder  = require 'pathfinder'\npathfinder  = new Pathfinder(root: process.cwd())\n    \npathfinder.compile (file, string) ->\n  console.log string\n  \npathfinder.requirements()\n```\n\n### Write to file\n\n``` javascript\noutputPath = (file) ->\n  relativePath = file.relativePath()\n  if relativePath.match(/^app\\/javascripts\\/(.*)/)\n    \"public/#{RegExp.$1}\"\n  else\n    \"public/#{relativePath}\"\n    \npathfinder.write outputPath: outputPath, (file, string) ->\n  console.log(\"Done!\") unless file\n```\n\n### Find the first file from an ambiguous source\n\n``` javascript\nfile = pathfinder.find \"application\"\n```\n\n### Update with a Watcher\n\nPathfinder.js doesn't include a watcher, but it's setup to be easy to use with one.  It's used in Design.io for example.\n\n``` javascript\nwatch /\\.(js|coffee)/\n  update: (file) ->\n    file.dirname()\n```\n\n### Compile `require` libraries for the browser\n\n``` javascript\npatfinder.writeRequirements()\n```\n\n### Manifests and Digests\n\nOutputs a JSON map of key to compressed, digest version of a file!\n\n## License\n\n(The MIT License)\n\nCopyright &copy; 2011 [Lance Pollard](http://twitter.com/viatropos) &lt;lancejpollard@gmail.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"}},"maintainers":[{"name":"viatropos","email":"lancejpollard@gmail.com"}],"time":{"modified":"2022-06-23T14:48:37.846Z","created":"2011-11-13T00:19:21.831Z","0.0.1":"2011-11-13T00:19:22.364Z","0.1.5":"2011-11-14T01:21:16.688Z","0.1.6":"2011-11-16T01:26:48.378Z","0.1.7":"2011-11-16T07:13:09.192Z","0.1.9":"2011-11-17T05:21:59.825Z","0.3.0":"2012-02-23T01:07:24.705Z","0.3.0-1":"2012-02-23T01:09:38.257Z"},"repository":{"type":"git","url":"git://github.com/viatropos/pathfinder.js.git"},"author":{"name":"Lance Pollard","email":"lancejpollard@gmail.com"}}