{"_id":"first-match","_rev":"5-f4ebfd369f537d979b29b3afe8a59d9f","name":"first-match","description":"Find the first element in an array that passes a callback test. Equivalent to underscore.find()","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"first-match","version":"0.0.1","description":"Find the first element in an array that passes a callback test. Equivalent to underscore.find()","main":"index.js","scripts":{"test":"node node_modules/.bin/mocha -u tdd --reporter spec"},"keywords":["element","array","first","truth","test","find"],"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"htttp://hughskennedy.com/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/first-match.git"},"devDependencies":{"mocha":"~1.7.4"},"readme":"# first-match [![Build Status](https://travis-ci.org/hughsk/first-match.png?branch=master)](https://travis-ci.org/hughsk/first-match?branch=master) #\n\nFinds the first element in an array that passes a callback test.\nEquivalent to [_.find()](http://underscorejs.org#find).\n\n## Installation ##\n\n``` bash\nnpm install first-match\n```\n\n## Usage ##\n\n`first(array, [iterator], [context])`. If an iterator is not passed, the method\nwill just return the first truthy value in the array. The context defaults to\nthe array being evaluated.\n\n``` javascript\nvar first = require('first-match')\n , array = [0, 1, 2, 3, 4, 5]\n\nfirst(array) // 1\nfirst(array, function(n) { return n > 3 }) // 4\nfirst(array, function(n) { return n % 2 }) // 1\nfirst(array, function(n) { return n + 2 > this.length }) // 5\n```","_id":"first-match@0.0.1","dist":{"shasum":"a60ec642700f0f437234ebb7ec3f382476e542fd","tarball":"https://registry.npmjs.org/first-match/-/first-match-0.0.1.tgz","integrity":"sha512-VvKbnaxrC0polTFDC+teKPTdl2mn6B/KUW+WB3C9RzKDeNwbzfLdnUz3FxC+tnjvus6bI0jWrWicQyVIPdS37A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4LdimMLFFbkE+UOqg8MnpRw2erZPkBQNjpnbtKSsaMAiBxagmT+kN3Mc2aI95RiK8aRdHvRRz0axs9i1d5NR3Y9w=="}]},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}]}},"readme":"# first-match [![Build Status](https://travis-ci.org/hughsk/first-match.png?branch=master)](https://travis-ci.org/hughsk/first-match?branch=master) #\n\nFinds the first element in an array that passes a callback test.\nEquivalent to [_.find()](http://underscorejs.org#find).\n\n## Installation ##\n\n``` bash\nnpm install first-match\n```\n\n## Usage ##\n\n`first(array, [iterator], [context])`. If an iterator is not passed, the method\nwill just return the first truthy value in the array. The context defaults to\nthe array being evaluated.\n\n``` javascript\nvar first = require('first-match')\n , array = [0, 1, 2, 3, 4, 5]\n\nfirst(array) // 1\nfirst(array, function(n) { return n > 3 }) // 4\nfirst(array, function(n) { return n % 2 }) // 1\nfirst(array, function(n) { return n + 2 > this.length }) // 5\n```","maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"time":{"modified":"2022-06-18T01:13:33.801Z","created":"2013-01-05T14:24:11.752Z","0.0.1":"2013-01-05T14:24:15.381Z"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"htttp://hughskennedy.com/"},"repository":{"type":"git","url":"git://github.com/hughsk/first-match.git"}}