{"name":"summary","description":"Takes an array of numbers and calculates some descriptive statistics","version":"2.0.0","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"./summary.js","scripts":{"test":"tap test.js"},"repository":{"type":"git","url":"git://github.com/AndreasMadsen/summary.git"},"keywords":["summary","sort","size","mode","mean","quartile","median","variance","sd"],"devDependencies":{"tap":"~14.0.0"},"license":"MIT","gitHead":"97e0b564032affd8ce90a97682e4a4fa0e2ddc4f","bugs":{"url":"https://github.com/AndreasMadsen/summary/issues"},"homepage":"https://github.com/AndreasMadsen/summary#readme","_id":"summary@2.0.0","_nodeVersion":"13.12.1-pre","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rUdoOxag922clGF6CSWtP4U0bV26hW/81paKDGU8X4haG7kV5ZkCU//UsvsqiKvEz0fPQMI8XfTj4ljgIDog1w==","shasum":"3cebce89b9dbaacffb1499ee264a3c2d2d36e52a","tarball":"http://registry-npm.ywwl.com/summary/download/summary-2.0.0.tgz","fileCount":5,"unpackedSize":13045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNTR3CRA9TVsSAnZWagAA0eYP+QBMQSp0iJ4Zxazh7CkM\nOE+LMyztCLmyuIdl3Zluno0SWBg0UC1vopr4WCvuSK+lKKFVvvnzWmYP/6fq\niXmgv+d4e8iEq4naRbIXeKk64NEzkQTpuv5BpaYJpMR+Z40NajgkunG7qm+8\ngjGadsU0DdfboQuJX6p8PFJ2bgGhIqjlQReGEvD7vz0b9I4kX/LlPTEIe6rc\nnD95KkudySl2TIsPHcrsnGHhgW/GeS9W7xsgpI7oPiQXy7dvcPfOFr5+vqwu\npeSf57jyEj8xrUORnP8KxD4WhbbZx+R0CcX5elydnVJOPSx7yLOA6V9teuIx\nXDgle1ybi8GIPZZFmSWsP6ems3K5YVy+ft0VYUteLtIu2YZX7BSWd5W0aRuC\nz4XHelvg++2F6epmeEKO/0QRE32jl7kZrdbs+RSVSPqDlGFJt02WOntnIkAt\nba7CAWri9AqJw9XtT5hzlVblCenSRx9ZP4721JXIgCcd0qNmqB8afDQXv104\nBHwZ/X6Qbg3JxSjHUKtdcdWlixBa5jt9vJ9zSQIk6O48hFGLwStHxEn/+/gG\nTgnHC5dpkol94GaqVReh2EWoYhQx2aqXRF/84fCOd7hnKeTwSykxrIODOZD3\nX++0fVkrUfV4V7GbMiksHTx2DqffhcI9uWwD5vaBiL848zsKOcCrEwDApWkk\nTVMX\r\n=/tE+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMCwc4/XliFi0Mt5O7UfgiyYOEW72BJlSxJ4v08Hcu8gIhANQZ/jAbRs9+lzzSqeM/ZXwd07Pw6dkBqVPR7urU7BfR"}],"size":3570,"noattachment":false,"key":"/summary/-/summary-2.0.0.tgz"},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/summary_2.0.0_1597322359505_0.06361950121223492"},"_hasShrinkwrap":false,"readme":"# summary\n\n> Takes an array of numbers and calculates some descriptive statistics\n\n## Installation\n\n```sheel\nnpm install summary\n```\n\n## Example\n\n```javascript\nvar summary = require('summary');\n\nvar data = summary([-1, 0, 1], true /* sorted */);\nconsole.log(data.variance()); // 1\nconsole.log(data.mean()); // 0\n```\n\n## Documentation\n\nThe `summary` constructor, takes a required `data` array and and optional\nboolean indication whether or not the `data` is `sorted` from small to big,\nby default `sorted` is `false`.\n\n```javascript\n// Data is sorted from small to big\nvar data = summary([-1, 0, 1], true);\n\n// Data is sorted, but summary dosn't know. Works fine just a bit slower.\nvar data = summary([-1, 0, 1] /*, default false */);\n\n// Data is sorted in reverse order\nvar data = summary([1, 0, -1] /*, default false */);\n\n// Data isn't sorted\nvar data = summary([0, 1, -1] /*, default false */);\n```\n\nThe data object has the following metods, note that almost all values is lazy\ncalculated and then cached.\n\n```javascript\ndata.data(); // Returns the original array\n\ndata.sort(); // Returns the sorted array\n\ndata.size(); // Returns the data length\n\ndata.sum(); // Returns the data sum\n\ndata.mode(); // Returns mode\n\ndata.mean(); // Returns the mean\n\ndata.quartile(0.25); // Returns 25% quartile\n\ndata.median(); // Returns the median\n\ndata.variance(); // Returns the variance\n\ndata.sd(); // Returns the standard deviation\n\ndata.max(); // Returns the maximum value\ndata.min(); // Returns the minimum value\n```\n\n## License\n\n**The software is license under \"MIT\"**\n\n> Copyright (c) 2013 Andreas Madsen\n>\n> Permission is hereby granted, free of charge, to any person obtaining a copy\n> of this software and associated documentation files (the \"Software\"), to deal\n> in the Software without restriction, including without limitation the rights\n> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n> copies of the Software, and to permit persons to whom the Software is\n> furnished to do so, subject to the following conditions:\n>\n> The above copyright notice and this permission notice shall be included in\n> all copies or substantial portions of the Software.\n>\n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n> THE SOFTWARE.\n","publish_time":1597322359671,"_cnpm_publish_time":1597322359671,"dist-tags":{"latest":"2.1.0"}}