{"id":42258176,"url":"https://github.com/pat310/quick-pivot","last_synced_at":"2026-01-27T05:36:55.464Z","repository":{"id":57144251,"uuid":"78970147","full_name":"pat310/quick-pivot","owner":"pat310","description":"Quickly format data to create a pivot table","archived":false,"fork":false,"pushed_at":"2022-10-06T13:13:04.000Z","size":434,"stargazers_count":65,"open_issues_count":4,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-10-02T07:55:56.123Z","etag":null,"topics":["javascript","pivot","pivot-tables"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/quick-pivot","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pat310.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-14T22:21:49.000Z","updated_at":"2025-01-16T18:09:32.000Z","dependencies_parsed_at":"2022-09-05T13:00:19.443Z","dependency_job_id":null,"html_url":"https://github.com/pat310/quick-pivot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pat310/quick-pivot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat310%2Fquick-pivot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat310%2Fquick-pivot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat310%2Fquick-pivot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat310%2Fquick-pivot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pat310","download_url":"https://codeload.github.com/pat310/quick-pivot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat310%2Fquick-pivot/sbom","scorecard":{"id":721689,"data":{"date":"2025-08-11","repo":{"name":"github.com/pat310/quick-pivot","commit":"1104f47d9efb8d1c0bcae45cd5e64a611181f08e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 5/18 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"79 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-2m96-9w4j-wgv7","Warn: Project is vulnerable to: GHSA-h726-x36v-rx45","Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T11:33:41.530Z","repository_id":57144251,"created_at":"2025-08-22T11:33:41.530Z","updated_at":"2025-08-22T11:33:41.530Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28804296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T03:44:14.111Z","status":"ssl_error","status_checked_at":"2026-01-27T03:43:33.507Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","pivot","pivot-tables"],"created_at":"2026-01-27T05:36:55.343Z","updated_at":"2026-01-27T05:36:55.444Z","avatar_url":"https://github.com/pat310.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM](https://nodei.co/npm/quick-pivot.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/quick-pivot/)\n\n[![npm version](https://badge.fury.io/js/quick-pivot.svg)](https://www.npmjs.com/package/quick-pivot)\n[![Build Status](https://img.shields.io/travis/pat310/quick-pivot.svg)](https://travis-ci.org/pat310/quick-pivot)\n[![Coverage Status](https://coveralls.io/repos/github/pat310/quick-pivot/badge.svg?branch=addingCoveralls)](https://coveralls.io/github/pat310/quick-pivot?branch=addingCoveralls)\n[![Code Climate](https://codeclimate.com/github/pat310/quick-pivot/badges/gpa.svg)](https://codeclimate.com/github/pat310/quick-pivot)\n[![Dependency Status](https://img.shields.io/david/pat310/quick-pivot.svg?style=flat-square)](https://david-dm.org/pat310/quick-pivot)\n\n## What it does\nSay you have this example data set:\u003cbr\u003e\n![example data](/screenshots/ss1.png)\n\nWith this tool you can pivot the data given a particular row and column category:\u003cbr\u003e\n![example pivot 1](/screenshots/ss2.png)\n\nOr given multiple rows and a column category:\u003cbr\u003e\n![example pivot 2](/screenshots/ss3.png)\n\nOr multiple columns and a row category:\u003cbr\u003e\n![example pivot 3](/screenshots/ss4.png)\n\nOr any combination of rows and/or columns\n\n## Example use\nInstall with npm:\n`npm install --save quick-pivot`\n\n\n```js\nimport Pivot from 'quick-pivot';\n\nconst dataArray = [\n ['name', 'gender', 'house', 'age'],\n ['Jon', 'm', 'Stark', 14],\n ['Arya', 'f', 'Stark', 10],\n ['Cersei', 'f', 'Baratheon', 38],\n ['Tywin', 'm', 'Lannister', 67],\n ['Tyrion', 'm', 'Lannister', 34],\n ['Joffrey', 'm', 'Baratheon', 18],\n ['Bran', 'm', 'Stark', 8],\n ['Jaime', 'm', 'Lannister', 32],\n ['Sansa', 'f', 'Stark', 12]\n];\n\nconst rowsToPivot = ['name'];\nconst colsToPivot = ['house', 'gender'];\nconst aggregationDimension = 'age';\nconst aggregator = 'sum';\n\nconst pivot = new Pivot(dataArray, rowsToPivot, colsToPivot, aggregationDimension, aggregator);\n\nconsole.log('pivot.data', pivot.data, 'pivot.data.table', pivot.data.table);\n```\n\nconsole logs:\n```js\npivot.data\n{ table:\n   [ { value: [Object], depth: 0, type: 'colHeader', row: 0 },\n     { value: [Object], depth: 1, type: 'colHeader', row: 1 },\n     { value: [Object], type: 'data', depth: 0, row: 2 },\n     { value: [Object], type: 'data', depth: 0, row: 3 },\n     { value: [Object], type: 'data', depth: 0, row: 4 },\n     { value: [Object], type: 'data', depth: 0, row: 5 },\n     { value: [Object], type: 'data', depth: 0, row: 6 },\n     { value: [Object], type: 'data', depth: 0, row: 7 },\n     { value: [Object], type: 'data', depth: 0, row: 8 },\n     { value: [Object], type: 'data', depth: 0, row: 9 },\n     { value: [Object], type: 'data', depth: 0, row: 10 },\n     { value: [Object], type: 'aggregated' } ],\n  rawData:\n   [ { value: [Object], depth: 0, type: 'colHeader', row: 0 },\n     { value: [Object], depth: 1, type: 'colHeader', row: 1 },\n     { value: [Object], type: 'data', depth: 0 },\n     { value: [Object], type: 'data', depth: 0 },\n     { value: [Object], type: 'data', depth: 0 },\n     { value: [Object], type: 'data', depth: 0 },\n     { value: [Object], type: 'data', depth: 0 },\n     { value: [Object], type: 'data', depth: 0 },\n     { value: [Object], type: 'data', depth: 0 },\n     { value: [Object], type: 'data', depth: 0 },\n     { value: [Object], type: 'data', depth: 0 } ] }\n\npivot.data.table\n[ { value:\n     [ 'sum age',\n       'Stark',\n       'Stark',\n       'Baratheon',\n       'Baratheon',\n       'Lannister',\n       'Totals' ],\n    depth: 0,\n    type: 'colHeader',\n    row: 0 },\n  { value: [ 'sum age', 'f', 'm', 'f', 'm', 'm', '' ],\n    depth: 1,\n    type: 'colHeader',\n    row: 1 },\n  { value: [ 'Arya', 10, '', '', '', '', 10 ],\n    type: 'data',\n    depth: 0,\n    row: 2 },\n  { value: [ 'Bran', '', 8, '', '', '', 8 ],\n    type: 'data',\n    depth: 0,\n    row: 3 },\n  { value: [ 'Cersei', '', '', 38, '', '', 38 ],\n    type: 'data',\n    depth: 0,\n    row: 4 },\n  { value: [ 'Jaime', '', '', '', '', 32, 32 ],\n    type: 'data',\n    depth: 0,\n    row: 5 },\n  { value: [ 'Joffrey', '', '', '', 18, '', 18 ],\n    type: 'data',\n    depth: 0,\n    row: 6 },\n  { value: [ 'Jon', '', 14, '', '', '', 14 ],\n    type: 'data',\n    depth: 0,\n    row: 7 },\n  { value: [ 'Sansa', 12, '', '', '', '', 12 ],\n    type: 'data',\n    depth: 0,\n    row: 8 },\n  { value: [ 'Tyrion', '', '', '', '', 34, 34 ],\n    type: 'data',\n    depth: 0,\n    row: 9 },\n  { value: [ 'Tywin', '', '', '', '', 67, 67 ],\n    type: 'data',\n    depth: 0,\n    row: 10 },\n  { value: [ 'Totals', 22, 22, 38, 18, 133, '' ], type: 'aggregated' } ]\n```\n\n## API\n### Pivot `data` value\nThe `data` value returns an object with keys `table` and `rawData`.  `table` is an array of objects with each object containing four keys (except for the last object which is an aggregated row of all the previous data rows based on the selected aggregation function):\n1. `value` - Array which contains the result of the pivot to be rendered\n2. `type` - Enumerated string describing what this data row contains, [`data`, `rowHeader`, or `colHeader`]\n3. `depth` - Number describing how deeply nested the row is within a parent row\n4. `row` - Number describing the original row index within the table\n\n`rawData` is an array of objects with three keys:\n1. `value` - Array which contains the data that makes up that particular row\n2. `type` - Enumerated string describing what this data row contains, [`data`, `rowHeader`, or `colHeader`]\n3. `depth` - Number describing how deeply nested the row is within a parent row\n\n### Syntax\n\n**Note:** If modules are not supported in your environment, you can also require `var Pivot = require('quick-pivot');`\n\n```js\nimport Pivot from 'quick-pivot';\n\nconst pivot = new Pivot(dataArray, rows, columns, [aggregationDimension or CBfunction], [aggregator or initialValue], rowHeader, sortFunction, columnSortFunction);\n```\n\n#### First way to use it:\n* `dataArray` **required** is one of the following:\n  * array of arrays ( the array in first index is assumed to be your headers, see the example above)\n  * array of objects (the keys of each object are the headers)\n  * a single array (a single column of data where the first element is the header)\n* `rows` is an array of strings (the rows you want to pivot on) or an empty array **required**\n* `columns` is an array of strings (the columns you want to pivot on) or an empty array **required**\n* `aggregationDimension` is a string (the category you want to accumulate values for) **required**\n* `aggregator` is an enumerated string - either `'sum'`, `'count'`, `'min'`, `'max'`, or `'average'` (the type of accumulation you want to perform). If no type is selected, `'count'` is chosen by default\n* `rowHeader` is a string (this value will appear above the rows)\n* `sortFunction` is a custom sorting function for rows. Default sorting used if null\n  * Sort Function should be in the form `(row) =\u003e (a,b) =\u003e Number`. This Function will be called for each row pivoted on (right to left) and must return \n    a traditional Array.sort function as a result.\n    A Function equaling `() =\u003e {}` will direct the Pivot to skip the sorting phase. \n* `columnSortFunction` is a custom sorting function for columns. No sorting used if undefined\n  * Column Sort Function should be in the form `(data, columns, columnIndex) =\u003e (a,b) =\u003e Number`. This Function will be called for each column pivoted on and must return \n    a traditional Array.sort function as a result. \n\n#### Second way to use it:\nParameters are the same as the first except for two, `aggregationDimension` and `aggregator`. Instead of `aggregationDimension` and `aggregator`, you can use the following:\n* `CBfunction` is a callback function that receives four parameters `CBfunction(acc, curr, index, arr)` where `acc` is an accumulation value, `curr` is the current element being processed, `index` is the index of the current element being processed and `arr` is the array that is being acted on. This function must return the accumulation value (this is very similar to javascript's `.reduce`) **required**\n* `initialValue` is the starting value for the callback function. If no starting value is selected, `0` is used by default.\n\n### Methods/Instance Variables\n#### `.data`\nInstance variable that returns the data array shown above\n\n#### `.update(dataArray, rows, columns, [aggregationDimension or CBfunction], [aggregator or initialValue], rowHeader)`\nUpdates the `.data` instance variable.  The `update` method is chainable.\n\n#### `.collapse(rowNum)`\nCollapses data into the specified row header provided.  `rowNum` is the row header's current index within the table (**Not** the original row index that is provided in the object).  The `collapse` method is chainable\n\n#### `.expand(rowNum)`\nExpands collapsed data that has previously been collapsed.  The `expand` method is chainable.\n\n#### `.collapseAll()`\nCollapses all data. The `collapseAll` method is chainable.\n\n#### `.expandAll()`\nExpands all data. The `expandAll` method is chainable.\n\n#### `.toggle(rowNum)`\nToggles data from collapsed to expanded or vice-versa. The `toggle` method is chainable.\n\n#### `.getData(rowNum)`\nReturns the data that comprises a collapsed row\n\n#### `.getUniqueValues(fieldName)`\nReturns all the unique values for a particular field as an array\n\n#### `.filter([fieldName or CBfunction], filterValues, [filterType])`\nFilters out values based on either:\n- string `fieldName` field to filter on, array `filterValues` values to filter, string `filterType` optional enumerated string either `'include'` or `'exclude'` (defaults to exclude if not provided)\n- function `CBfunction(element, index, array)` which iterates over each element in array (similar to Javascript array `.filter` method)\n\n\n### Example with callback function\nCheck out [the  test spec for more examples](/test/index.spec.js).\n\n```js\nimport Pivot from 'quick-pivot';\n\nfunction cbFunc(acc, curr, index, arr){\n  acc += curr.age;\n  if(index === arr.length - 1) return acc / arr.length;\n  return acc;\n}\nconst pivot = new Pivot(dataArray, ['gender'], ['house'], cbFunc, 0, 'average age');\n\nconsole.log(pivot.data.table);\n/*\n[ { value: [ 'average age', 'Stark', 'Baratheon', 'Lannister', 'Totals' ],\n    depth: 0,\n    type: 'colHeader',\n    row: 0 },\n  { value: [ 'f', 11, 38, '', 20 ], type: 'data', depth: 0, row: 1 },\n  { value: [ 'm', 11, 18, 44.333333333333336, 28.833333333333332 ],\n    type: 'data',\n    depth: 0,\n    row: 2 },\n  { value: [ 'Totals', 11, 28, 44.333333333333336, '' ],\n    type: 'aggregated' } ]\n*/\n\npivot.update(dataArray, ['gender', 'name'], ['house'], cbFunc, 0, 'average age')\n\nconsole.log(pivot.data.table);\n/*\n[ { value: [ 'average age', 'Stark', 'Baratheon', 'Lannister', 'Totals' ],\n    depth: 0,\n    type: 'colHeader',\n    row: 0 },\n  { value: [ 'f', 11, 38, '', '' ],\n    depth: 0,\n    type: 'rowHeader',\n    row: 1 },\n  { value: [ 'Arya', 10, '', '', 10 ],\n    type: 'data',\n    depth: 1,\n    row: 2 },\n  { value: [ 'Cersei', '', 38, '', 38 ],\n    type: 'data',\n    depth: 1,\n    row: 3 },\n  { value: [ 'Sansa', 12, '', '', 12 ],\n    type: 'data',\n    depth: 1,\n    row: 4 },\n  { value: [ 'm', 11, 18, 44.333333333333336, '' ],\n    depth: 0,\n    type: 'rowHeader',\n    row: 5 },\n  { value: [ 'Bran', 8, '', '', 8 ],\n    type: 'data',\n    depth: 1,\n    row: 6 },\n  { value: [ 'Jaime', '', '', 32, 32 ],\n    type: 'data',\n    depth: 1,\n    row: 7 },\n  { value: [ 'Joffrey', '', 18, '', 18 ],\n    type: 'data',\n    depth: 1,\n    row: 8 },\n  { value: [ 'Jon', 14, '', '', 14 ],\n    type: 'data',\n    depth: 1,\n    row: 9 },\n  { value: [ 'Tyrion', '', '', 34, 34 ],\n    type: 'data',\n    depth: 1,\n    row: 10 },\n  { value: [ 'Tywin', '', '', 67, 67 ],\n    type: 'data',\n    depth: 1,\n    row: 11 },\n  { value: [ 'Totals', 11, 28, 44.333333333333336, '' ],\n    type: 'aggregated' } ]\n*/\n\npivot.collapse(1);\n\nconsole.log(pivot.data.table);\n/*\n[ { value: [ 'average age', 'Stark', 'Baratheon', 'Lannister', 'Totals' ],\n    depth: 0,\n    type: 'colHeader',\n    row: 0 },\n  { value: [ 'f', 11, 38, '', '' ],\n    depth: 0,\n    type: 'rowHeader',\n    row: 1 },\n  { value: [ 'm', 11, 18, 44.333333333333336, '' ],\n    depth: 0,\n    type: 'rowHeader',\n    row: 5 },\n  { value: [ 'Bran', 8, '', '', 8 ],\n    type: 'data',\n    depth: 1,\n    row: 6 },\n  { value: [ 'Jaime', '', '', 32, 32 ],\n    type: 'data',\n    depth: 1,\n    row: 7 },\n  { value: [ 'Joffrey', '', 18, '', 18 ],\n    type: 'data',\n    depth: 1,\n    row: 8 },\n  { value: [ 'Jon', 14, '', '', 14 ],\n    type: 'data',\n    depth: 1,\n    row: 9 },\n  { value: [ 'Tyrion', '', '', 34, 34 ],\n    type: 'data',\n    depth: 1,\n    row: 10 },\n  { value: [ 'Tywin', '', '', 67, 67 ],\n    type: 'data',\n    depth: 1,\n    row: 11 },\n  { value: [ 'Totals', 11, 28, 44.333333333333336, '' ],\n    type: 'aggregated' } ]\n*/\n\nconsole.log(pivot.getData(1));\n/*\n[ { value: [ 'Arya', [Array], '', '' ], type: 'data', depth: 1 },\n  { value: [ 'Cersei', '', [Array], '' ], type: 'data', depth: 1 },\n  { value: [ 'Sansa', [Array], '', '' ], type: 'data', depth: 1 } ]\n*/\n\nconsole.log(pivot.getData(1)[0].value)\n/*\n[ 'Arya',\n  [ { name: 'Arya', gender: 'f', house: 'Stark', age: 10 } ],\n  '',\n  '' ]\n*/\n\npivot.collapse(2);\n\nconsole.log(pivot.data.table);\n/*\n[ { value: [ 'average age', 'Stark', 'Baratheon', 'Lannister', 'Totals' ],\n    depth: 0,\n    type: 'colHeader',\n    row: 0 },\n  { value: [ 'f', 11, 38, '', '' ],\n    depth: 0,\n    type: 'rowHeader',\n    row: 1 },\n  { value: [ 'm', 11, 18, 44.333333333333336, '' ],\n    depth: 0,\n    type: 'rowHeader',\n    row: 5 },\n  { value: [ 'Totals', 11, 28, 44.333333333333336, '' ],\n    type: 'aggregated' } ]\n*/\n\npivot.expand(1);\nconsole.log(pivot.data.table);\n/*\n[ { value: [ 'average age', 'Stark', 'Baratheon', 'Lannister', 'Totals' ],\n    depth: 0,\n    type: 'colHeader',\n    row: 0 },\n  { value: [ 'f', 11, 38, '', '' ],\n    depth: 0,\n    type: 'rowHeader',\n    row: 1 },\n  { value: [ 'Arya', 10, '', '', 10 ],\n    type: 'data',\n    depth: 1,\n    row: 2 },\n  { value: [ 'Cersei', '', 38, '', 38 ],\n    type: 'data',\n    depth: 1,\n    row: 3 },\n  { value: [ 'Sansa', 12, '', '', 12 ],\n    type: 'data',\n    depth: 1,\n    row: 4 },\n  { value: [ 'm', 11, 18, 44.333333333333336, '' ],\n    depth: 0,\n    type: 'rowHeader',\n    row: 5 },\n  { value: [ 'Totals', 11, 28, 44.333333333333336, '' ],\n    type: 'aggregated' } ]\n```\n\n## Changes\nCheck out the [change log](/CHANGES.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpat310%2Fquick-pivot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpat310%2Fquick-pivot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpat310%2Fquick-pivot/lists"}