{"name":"helper-resolve","description":"Template helper to resolve the path to a file in node_modules. This is mostly useful during development.","version":"0.3.0","homepage":"https://github.com/jonschlinkert/helper-resolve","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/helper-resolve"},"bugs":{"url":"https://github.com/jonschlinkert/helper-resolve/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"chalk":"^1.0.0","clone-deep":"^0.1.1","relative":"^3.0.0"},"devDependencies":{"engine-lodash":"^0.6.2","handlebars":"^3.0.1","jquery":"^2.1.3","mocha":"*","should":"*","template":"^0.12.6"},"keywords":[],"gitHead":"583ca1d0107f7656beed3545143f027c0f2170b8","_id":"helper-resolve@0.3.0","_shasum":"d1e8545c43c85cbef79f285b52b2cb58f9b4666f","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"d1e8545c43c85cbef79f285b52b2cb58f9b4666f","tarball":"http://registry-npm.ywwl.com/helper-resolve/download/helper-resolve-0.3.0.tgz","integrity":"sha512-sZcxxZT6HYWdaoRjIC25UrAnbSBBOdUAD/qvVanxk2/YEBGRS7iK0bCxKIDi36/Z25peY+1Th4gGjVAkdOE7kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+wDLecXrGT4wA5iZ3rmjo5aFi5BkdupT3OEth7OK/KAiEA0RK96zFBR532r520GvVNs/+KqM3/dHkzsRJh6rxuLOM="}],"size":2575,"noattachment":false,"key":"/helper-resolve/-/helper-resolve-0.3.0.tgz"},"directories":{},"readme":"# helper-resolve [![NPM version](https://badge.fury.io/js/helper-resolve.svg)](http://badge.fury.io/js/helper-resolve)  [![Build Status](https://travis-ci.org/jonschlinkert/helper-resolve.svg)](https://travis-ci.org/jonschlinkert/helper-resolve) \n\n> Template helper to resolve the path to a file in node_modules. This is mostly useful during development.\n\nRefactored to return an object, so the results of the helper can be passed to other helpers that require more information.\n\n## Install with [npm](npmjs.org)\n\n```bash\nnpm i helper-resolve --save\n```\n\n## Usage\n\n```js\nvar resolve = require('helper-resolve');\nvar Handlebars = require('handlebars');\n\nhandlebars.registerHelper('resolve', function (name, key) {\n  return resolve.sync(fp)[typeof key === 'string' ? key : 'main'];\n});\nhandlebars.compile('<script src=\\\"{{resolve \"jquery\" \"main\"}}\\\"></script>')().\n//=> '<script src=\"node_modules/jquery/dist/jquery.js\"></script>'\n\nhandlebars.compile('{{resolve \"jquery\" \"homepage\"}}')().\n//=> 'http://jquery.com'\n```\n\n## Assemble example\n\nRegister the helper with [assemble] v0.6.x to use with any template engine:\n\n```js\nvar assemble = require('assemble');\nassemble.helper('resolve', function (name, key) {\n  return resolve.sync(fp)[typeof key === 'string' ? key : 'main'];\n});\n```\n\n**async helper**\n\n```js\nassemble.asyncHelper('resolve', function (name, key, cb) {\n  if (typeof key === 'function') {\n    cb = key;\n    key = 'main';\n  }\n\n  resolve(name, function (err, res) {\n    cb(null, res[key]);\n  });\n});\n```\n\n## Run tests\nInstall dev dependencies:\n\n```bash\nnpm i -d && npm test\n```\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/helper-resolve/issues)\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) \n\n## License\nCopyright (c) 2015 Jon Schlinkert  \nReleased under the MIT license\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on April 19, 2015._\n\n[assemble]: https://github.com/assemble/assemble\n","publish_time":1429428265746,"_cnpm_publish_time":1429428265746,"dist-tags":{"latest":"0.3.1"}}