{"_id":"helper-resolve","_rev":"94400","name":"helper-resolve","description":"Template helper to resolve the path to a file in node_modules. This is mostly useful during development.","dist-tags":{"latest":"0.3.1"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:31:26.000Z","created":"2015-02-15T11:28:46.658Z","0.3.1":"2015-04-19T07:34:40.639Z","0.3.0":"2015-04-19T07:24:25.746Z","0.2.0":"2015-02-27T16:16:44.082Z","0.1.2":"2015-02-23T19:54:36.579Z","0.1.1":"2015-02-22T00:43:10.298Z","0.1.0":"2015-02-15T11:28:46.658Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/helper-resolve"},"versions":{"0.3.1":{"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.1","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.1","_shasum":"6906c806c48b593afcd1b2248d7a55d9c42f9d70","_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":"6906c806c48b593afcd1b2248d7a55d9c42f9d70","size":2638,"noattachment":false,"key":"/helper-resolve/-/helper-resolve-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-resolve/download/helper-resolve-0.3.1.tgz"},"directories":{},"publish_time":1429428880639,"_cnpm_publish_time":1429428880639,"_hasShrinkwrap":false},"0.3.0":{"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","size":2575,"noattachment":false,"key":"/helper-resolve/-/helper-resolve-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-resolve/download/helper-resolve-0.3.0.tgz"},"directories":{},"publish_time":1429428265746,"_cnpm_publish_time":1429428265746,"_hasShrinkwrap":false},"0.2.0":{"name":"helper-resolve","description":"Template helper to resolve the path to a file in node_modules. This is mostly useful during development.","version":"0.2.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","lodash":"^3.2.0","relative":"^2.0.0"},"devDependencies":{"handlebars":"^3.0.0","jquery":"^2.1.3","mocha":"*","resolve":"^1.1.0","should":"*","template":"^0.9.3"},"keywords":[],"gitHead":"c89dca5e442a61263c61dcb43d687f1971714558","_id":"helper-resolve@0.2.0","_shasum":"8d69f2c0b36b4bf15e74bb8abc47475e5d724c76","_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":"8d69f2c0b36b4bf15e74bb8abc47475e5d724c76","size":2331,"noattachment":false,"key":"/helper-resolve/-/helper-resolve-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-resolve/download/helper-resolve-0.2.0.tgz"},"directories":{},"publish_time":1425053804082,"_cnpm_publish_time":1425053804082,"_hasShrinkwrap":false},"0.1.2":{"name":"helper-resolve","description":"Template helper to resolve the path to a file in node_modules. This is mostly useful during development.","version":"0.1.2","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":{"lodash":"^3.2.0","resolve":"^1.1.0"},"devDependencies":{"handlebars":"^3.0.0","jquery":"^2.1.3","mocha":"*","resolve":"^1.1.0","should":"*","template":"^0.9.3"},"keywords":[],"gitHead":"c89dca5e442a61263c61dcb43d687f1971714558","_id":"helper-resolve@0.1.2","_shasum":"f1dd91bd298204248914e22088f61099c278d1a6","_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":"f1dd91bd298204248914e22088f61099c278d1a6","size":2034,"noattachment":false,"key":"/helper-resolve/-/helper-resolve-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-resolve/download/helper-resolve-0.1.2.tgz"},"directories":{},"publish_time":1424721276579,"_cnpm_publish_time":1424721276579,"_hasShrinkwrap":false},"0.1.1":{"name":"helper-resolve","description":"Template helper to resolve the path to a file in node_modules. This is mostly useful during development.","version":"0.1.1","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":{"lodash":"^3.2.0","resolve":"^1.1.0"},"devDependencies":{"handlebars":"^3.0.0","jquery":"^2.1.3","mocha":"*","resolve":"^1.1.0","should":"*","template":"^0.9.3"},"keywords":[],"gitHead":"86bab4d25d7a0ce6f27e7a8f4ff6c2f1700022bf","_id":"helper-resolve@0.1.1","_shasum":"596e9f00f3aeaac1f25689821cebbee023360ca5","_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":"596e9f00f3aeaac1f25689821cebbee023360ca5","size":2014,"noattachment":false,"key":"/helper-resolve/-/helper-resolve-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-resolve/download/helper-resolve-0.1.1.tgz"},"directories":{},"publish_time":1424565790298,"_cnpm_publish_time":1424565790298,"_hasShrinkwrap":false},"0.1.0":{"name":"helper-resolve","description":"Template helper to resolve the path to a file in node_modules. This is mostly useful during development.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/helper-resolve","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/helper-resolve.git"},"bugs":{"url":"https://github.com/jonschlinkert/helper-resolve/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/helper-resolve/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"resolve":"^1.1.0"},"devDependencies":{"handlebars":"^3.0.0","jquery":"^2.1.3","lodash":"^3.2.0","mocha":"*","resolve":"^1.1.0","should":"*","template":"^0.9.3"},"keywords":[],"gitHead":"38eb2c3d093dd3193b459020f096eaf2236eda6f","_id":"helper-resolve@0.1.0","_shasum":"7721091ebb9a647594b080f6a30de7b908d6fa49","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"7721091ebb9a647594b080f6a30de7b908d6fa49","size":1399,"noattachment":false,"key":"/helper-resolve/-/helper-resolve-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/helper-resolve/download/helper-resolve-0.1.0.tgz"},"directories":{},"publish_time":1423999726658,"_cnpm_publish_time":1423999726658,"_hasShrinkwrap":false}},"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","_attachments":{},"homepage":"https://github.com/jonschlinkert/helper-resolve","bugs":{"url":"https://github.com/jonschlinkert/helper-resolve/issues"},"license":"MIT"}