{"_id":"resolve-bower","_rev":"8-ab0cd7028fc60d000743c976efa5a140","name":"resolve-bower","description":"like require.resolve() on behalf of bower files asynchronously and synchronously","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"resolve-bower","description":"like require.resolve() on behalf of bower files asynchronously and synchronously","version":"0.0.1","repository":{"type":"git","url":"git://github.com/cellvia/resolve-bower.git"},"main":"index.js","keywords":["resolve-bower","resolve","require","node","bower","module"],"scripts":{"test":"tap test/*.js"},"devDependencies":{"tap":"~0.4.0"},"license":"MIT","gitHead":"7c273462b4eb81720ff27b972f4feb5ae1a52526","bugs":{"url":"https://github.com/cellvia/resolve-bower/issues"},"homepage":"https://github.com/cellvia/resolve-bower","_id":"resolve-bower@0.0.1","_shasum":"0ce69ebb19604302b163abd9d8d8da154555d0f2","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"cellvia","email":"brandon.selway@gmail.com"},"maintainers":[{"name":"cellvia","email":"brandon.selway@gmail.com"}],"dist":{"shasum":"0ce69ebb19604302b163abd9d8d8da154555d0f2","tarball":"https://registry.npmjs.org/resolve-bower/-/resolve-bower-0.0.1.tgz","integrity":"sha512-cVAgSJCLVVXFPE4SoUoOl43KU75I0HRgveK9VTXMOM2U5p5RgIL0tS+SBUrnU96qh1KNSPqsWGLWgLPJaw/EIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDL0HIYduA+jE9KqdbfzANLEkp2BmH4Ia720N2RYhkG5AIgIf/Urvqlaf35E/ckNcDWMZcY1tFYaR2jCgcif0Mk35M="}]}}},"readme":"# resolve-bower\n\nbased off of substack's [resolve](http://github.com/substack/node-resolve)\n\nimplements the [node `require.resolve()`\nalgorithm](http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...)\nsuch that you can `require.resolve()` on behalf of a bower file asynchronously and\nsynchronously\n\n[![build status](https://secure.travis-ci.org/substack/node-resolve.png)](http://travis-ci.org/substack/node-resolve)\n\n# example\n\nasynchronously resolve:\n\n``` js\nvar resolve = require('resolve-bower');\nresolve('tap', { basedir: __dirname }, function (err, res) {\n    if (err) console.error(err)\n    else console.log(res)\n});\n```\n\n```\n$ node example/async.js\n/home/substack/projects/node-resolve/bower_components/tap/lib/main.js\n```\n\nsynchronously resolve:\n\n``` js\nvar resolve = require('resolve-bower');\nvar res = resolve.sync('tap', { basedir: __dirname });\nconsole.log(res);\n```\n\n```\n$ node example/sync.js\n/home/substack/projects/node-resolve/bower_components/tap/lib/main.js\n```\n\n# methods\n\n``` js\nvar resolve = require('resolve-bower')\n```\n\n## resolve(pkg, opts={}, cb)\n\nAsynchronously resolve the module path string `pkg` into `cb(err, res)`.\n\noptions are:\n\n* opts.basedir - directory to begin resolving from\n\n* opts.package - package from which module is being loaded\n\n* opts.extensions - array of file extensions to search in order\n\n* opts.readFile - how to read files asynchronously\n\n* opts.isFile - function to asynchronously test whether a file exists\n\n* opts.packageFilter - transform the parsed bower.json contents before looking\nat the \"main\" field\n\n* opts.paths - require.paths array to use if nothing is found on the normal\nbower_components recursive walk (probably don't use this)\n\n* opts.moduleDirectory - directory to recursively look for modules in. default:\n`\"bower_components\"`\n\ndefault `opts` values:\n\n``` javascript\n{\n    paths: [],\n    basedir: __dirname,\n    extensions: [ '.js' ],\n    readFile: fs.readFile,\n    isFile: function (file, cb) {\n        fs.stat(file, function (err, stat) {\n            if (err && err.code === 'ENOENT') cb(null, false)\n            else if (err) cb(err)\n            else cb(null, stat.isFile())\n        });\n    },\n    moduleDirectory: 'bower_components'\n}\n```\n\n## resolve.sync(pkg, opts)\n\nSynchronously resolve the module path string `pkg`, returning the result and\nthrowing an error when `pkg` can't be resolved.\n\noptions are:\n\n* opts.basedir - directory to begin resolving from\n\n* opts.extensions - array of file extensions to search in order\n\n* opts.readFile - how to read files synchronously\n\n* opts.isFile - function to synchronously test whether a file exists\n\n* opts.packageFilter - transform the parsed bower.json contents before looking\nat the \"main\" field\n\n* opts.paths - require.paths array to use if nothing is found on the normal\nbower_components recursive walk (probably don't use this)\n\n* opts.moduleDirectory - directory to recursively look for modules in. default:\n`\"bower_components\"`\n\ndefault `opts` values:\n\n``` javascript\n{\n    paths: [],\n    basedir: __dirname,\n    extensions: [ '.js' ],\n    readFileSync: fs.readFileSync,\n    isFile: function (file) {\n        try { return fs.statSync(file).isFile() }\n        catch (e) { return false }\n    },\n    moduleDirectory: 'bower_components'\n}\n````\n\n## resolve.isCore(pkg)\n\nReturn whether a package is in core.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install resolve\n```\n\n# license\n\nMIT\n","maintainers":[{"name":"cellvia","email":"brandon.selway@gmail.com"}],"time":{"modified":"2022-06-26T11:51:58.237Z","created":"2014-09-25T04:24:08.641Z","0.0.1":"2014-09-25T04:24:08.641Z"},"homepage":"https://github.com/cellvia/resolve-bower","keywords":["resolve-bower","resolve","require","node","bower","module"],"repository":{"type":"git","url":"git://github.com/cellvia/resolve-bower.git"},"bugs":{"url":"https://github.com/cellvia/resolve-bower/issues"},"license":"MIT","readmeFilename":"readme.markdown","users":{"monolithed":true,"cognivator":true}}