{"bugs":{"url":"https://github.com/inca/flatmapjs/issues"},"dist":{"shasum":"aa4b7c96ea72d2eda504c46aef77808625fab3bf","tarball":"https://registry.npmjs.org/flatmap/-/flatmap-0.0.2.tgz","integrity":"sha512-qvQVLl3vaDqkXmcMFwjCyajNtmJ9JxDs5a3szfcCprBplN1dVrdDOt+zNQ8buRLdaqcvZRHb4/S08DgFasCRdw==","signatures":[{"sig":"MEUCIQDJO/YRnZAlFanXdFZ/wyX7k+GEXeaWjBdfDpoUrdKQ1QIgIoFxqDzpOOd32qcURkwwyWnvcLIqZxaFnzaAYdEirrA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","name":"flatmap","_from":".","author":{"name":"Boris Okunskiy"},"readme":"# flatMap — the missing function for functional Node\n\nThose who use [underscorejs](https://github.com/jashkenas/underscore) are often\n[very](https://github.com/jashkenas/underscore/issues/436) [sad](https://github.com/jashkenas/underscore/issues/452), because there is no `flatMap` function.\n\nSo, ...\n\n## Usage\n\n```\nnpm install flatmap\n```\n\n```\nvar flatMap = require('flatmap');\n```\n\nJust like `map`, `flatMap` accepts three arguments:\n\n  * the `array` to be traversed\n  * the `iterator` function, which is invoked with three parameters\n\n        * `value` currently iterated\n        * optional `index` of current iteration\n        * and optional `array` being iterated\n\n  * the `context` value, which will be `this` inside the `iterator` function.\n\nExample:\n\n```\nflatMap(['Hi', 'World'], function(word) {\n  return word.split('');\n});\n// ['H', 'i', 'W', 'o', 'r', 'l', 'd']\n```\n\nThe `iterator` function can return either a value (in that case it is simply appended to results) or an array (in that case the array is concatenated with results).\n\nReturning `null` or `undefined` from `iterator` will append nothing to the results.\n\n**Heads up!** This is not equivalent to `_.compose(_.flatten, _.map)`, since nested sub-arrays are **not flattened**.\n\n### License\n\nCopyright (C) 2013 Boris Okunskiy <boris@okunskiy.name> (MIT license)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\nOR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n\n\n","license":"MIT","_npmUser":{"name":"inca","email":"boris@okunskiy.name"},"keywords":["fp","functional programming","flatMap"],"repository":{"url":"https://github.com/inca/flatmapjs","type":"git"},"_npmVersion":"1.3.11","description":"The missing flatMap function for Node","maintainers":[{"name":"inca","email":"boris@okunskiy.name"}],"readmeFilename":"README.md","devDependencies":{"mocha":"*"},"_id":"flatmap@0.0.2","version":"0.0.2"}