{"id":20119239,"url":"https://github.com/harrystevens/arraygeous","last_synced_at":"2025-05-06T14:32:17.500Z","repository":{"id":35131449,"uuid":"210721247","full_name":"HarryStevens/arraygeous","owner":"HarryStevens","description":"A JavaScript library for lightning fast array manipulation.","archived":false,"fork":false,"pushed_at":"2023-01-04T11:18:07.000Z","size":320,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T07:30:18.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/arraygeous","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/HarryStevens.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-09-25T00:25:26.000Z","updated_at":"2024-04-14T07:30:18.506Z","dependencies_parsed_at":"2023-01-15T14:27:27.435Z","dependency_job_id":null,"html_url":"https://github.com/HarryStevens/arraygeous","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Farraygeous","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Farraygeous/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Farraygeous/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarryStevens%2Farraygeous/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarryStevens","download_url":"https://codeload.github.com/HarryStevens/arraygeous/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224509424,"owners_count":17323079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T19:14:52.406Z","updated_at":"2024-11-13T19:14:52.964Z","avatar_url":"https://github.com/HarryStevens.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arraygeous\nA JavaScript library for lightning fast array manipulation. [![Build Status](https://travis-ci.org/HarryStevens/arraygeous.svg?branch=master)](https://travis-ci.org/HarryStevens/arraygeous)\n\n## Installation\n\n### Web browser\nIn vanilla, a `arr` global is exported. You can use the latest version from unpkg.\n```html\n\u003cscript src=\"https://unpkg.com/arraygeous@0.1.24/build/arraygeous.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/arraygeous@0.1.24/build/arraygeous.min.js\"\u003e\u003c/script\u003e\n```\nIf you'd rather host it yourself, download the latest release from the [`build` directory](https://github.com/HarryStevens/arraygeous/tree/master/build).\n\n### npm\n\n```bash\nnpm i arraygeous -S\n```\n```js\nconst arr = require(\"arraygeous\");\n```\n\n## API\n\narraygeous provides three types of functions.\n- [Native](#native) JavaScript functions that run faster because arraygeous uses for loops.\n- [Special](#special) functions that are not included among JavaScript's native array functions.\n- [Math](#math) functions that perform arithmetic on arrays.\n\nYou can also call multiple functions on the same array by using arr.\u003cb\u003epipe\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e). Return the result of the pipe with \u003ci\u003epipe\u003c/i\u003e.\u003cb\u003eresult\u003c/b\u003e().\n\n### Native\n\n\u003ca name=\"every\" href=\"#every\"\u003e#\u003c/a\u003e arr.\u003cb\u003eevery\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003etest\u003c/i\u003e) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/every.js)\n\nReturns a boolean representing whether every item in an \u003ci\u003earray\u003c/i\u003e passes a \u003ci\u003etest\u003c/i\u003e function.\n\n\u003ca name=\"filter\" href=\"#filter\"\u003e#\u003c/a\u003e arr.\u003cb\u003efilter\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003etest\u003c/i\u003e) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/filter.js)\n\nReturns a new array with every element in an \u003ci\u003earray\u003c/i\u003e that passes a \u003ci\u003etest\u003c/i\u003e, specified as a function.\n\n\u003ca name=\"find\" href=\"#find\"\u003e#\u003c/a\u003e arr.\u003cb\u003efind\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003etest\u003c/i\u003e) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/find.js)\n\nReturns the value of the first element in an \u003ci\u003earray\u003c/i\u003e that passes a \u003ci\u003etest\u003c/i\u003e, specified as a function.\n\n\u003ca name=\"findIndex\" href=\"#findIndex\"\u003e#\u003c/a\u003e arr.\u003cb\u003efindIndex\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003etest\u003c/i\u003e) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/findIndex.js)\n\nReturns the index of the first element in an \u003ci\u003earray\u003c/i\u003e that passes a \u003ci\u003etest\u003c/i\u003e, specified as a function. Returns -1 if no element passes the test.\n\n\u003ca name=\"includes\" href=\"#includes\"\u003e#\u003c/a\u003e arr.\u003cb\u003eincludes\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003evalue\u003c/i\u003e[, \u003ci\u003estart\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/includes.js)\n\nReturns a boolean representing whether an \u003ci\u003earray\u003c/i\u003e includes a \u003ci\u003evalue\u003c/i\u003e. You can specify where in the array to begin the seach with an optional \u003ci\u003estart\u003c/i\u003e index.\n\n\u003ca name=\"map\" href=\"#map\"\u003e#\u003c/a\u003e arr.\u003cb\u003emap\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003eaccessor\u003c/i\u003e) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/map.js)\n\nReturns a new array with the result of calling an \u003ci\u003eaccessor\u003c/i\u003e function for each \u003ci\u003earray\u003c/i\u003e element.\n\n\u003ca name=\"some\" href=\"#some\"\u003e#\u003c/a\u003e arr.\u003cb\u003esome\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003etest\u003c/i\u003e) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/some.js)\n\nReturns a boolean representing whether any item in an \u003ci\u003earray\u003c/i\u003e passes a \u003ci\u003etest\u003c/i\u003e function.\n\n### Special\n\n\u003ca name=\"closest\" href=\"#closest\"\u003e#\u003c/a\u003e arr.\u003cb\u003eclosest\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003evalue\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/closest.js)\n\nReturns the closest element in an \u003ci\u003earray\u003c/i\u003e to a \u003ci\u003evalue\u003c/i\u003e, ignoring invalid values (null, undefined, NaN, Infinity) in the array. The array can be mapped to an optional \u003ci\u003eaccessor\u003c/i\u003e function.\n\n\u003ca name=\"count\" href=\"#count\"\u003e#\u003c/a\u003e arr.\u003cb\u003ecount\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/count.js)\n\nReturns an array of objects, where each object represents a unique value from an input \u003ci\u003earray\u003c/i\u003e, according to an optional \u003ci\u003eaccessor\u003c/i\u003e function, and the number of items that value appears in the array.\n\n\u003ca name=\"flatten\" href=\"#flatten\"\u003e#\u003c/a\u003e arr.\u003cb\u003eflatten\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/flatten.js)\n\nReturns a single array from an \u003ci\u003earray\u003c/i\u003e of arrays. You can map each item in the array to the value returned by an optional \u003ci\u003eaccessor\u003c/i\u003e function.\n\n\u003ca name=\"random\" href=\"#random\"\u003e#\u003c/a\u003e arr.\u003cb\u003erandom\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/random.js)\n\nReturns a random item from an \u003ci\u003earray\u003c/i\u003e.\n\n\u003ca name=\"sort\" href=\"#sort\"\u003e#\u003c/a\u003e arr.\u003cb\u003esort\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e[, \u003ci\u003eorder\u003c/i\u003e]]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/sort.js)\n\nSorts an \u003ci\u003earray\u003c/i\u003e. You can map each item in the array to the value returned by an optional \u003ci\u003eaccessor\u003c/i\u003e function. Defaults to ascending order, but you can return descending order by specifying the third argument, order, as the string \"desc\". Invalid values other than Infinity and -Infinity (null, undefined, NaN) will be moved to the end.\n\n\u003ca name=\"unique\" href=\"#unique\"\u003e#\u003c/a\u003e arr.\u003cb\u003eunique\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/unique.js)\n\nReturns the unique values of an \u003ci\u003earray\u003c/i\u003e. You can map each item in the array to the value returned by an optional \u003ci\u003eaccessor\u003c/i\u003e function.\n\n### Math\n\n\u003ca name=\"cor\" href=\"#cor\"\u003e#\u003c/a\u003e arr.\u003cb\u003ecor\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/cor.js)\n\nReturns the [correlation coefficient](https://en.wikipedia.org/wiki/bivariate_correlation) of an \u003ci\u003earray\u003c/i\u003e of paired values, where each pair is an array of two values. If your data is an array of objects, you can map each item in the array to a pair of values with optional \u003ci\u003ex-\u003c/i\u003e and \u003ci\u003ey-\u003c/i\u003eaccessor functions.\n\n\u003ca name=\"cumsum\" href=\"#cumsum\"\u003e#\u003c/a\u003e arr.\u003cb\u003ecumsum\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/cumsum.js)\n\nReturns the iterated cumulative sum of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"deviation\" href=\"#deviation\"\u003e#\u003c/a\u003e arr.\u003cb\u003edeviation\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/deviation.js)\n\nReturns the standard deviation of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"diff\" href=\"#diff\"\u003e#\u003c/a\u003e arr.\u003cb\u003ediff\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e[, \u003ci\u003elag\u003c/i\u003e]]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/diff.js)\n\nReturns lagged and iterated differences of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. You can pass a third a third argument, \u003ci\u003elag\u003c/i\u003e, which is an integer indicating how many indices back to calculate the lag\n\n\u003ca name=\"extent\" href=\"#extent\"\u003e#\u003c/a\u003e arr.\u003cb\u003eextent\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/extent.js)\n\nReturns the minimum and maximum, represented as [minimum, maximum], of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"max\" href=\"#max\"\u003e#\u003c/a\u003e arr.\u003cb\u003emax\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/max.js)\n\nReturns the maximum of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"maxIndex\" href=\"#maxIndex\"\u003e#\u003c/a\u003e arr.\u003cb\u003emaxIndex\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/maxIndex.js)\n\nReturns the index of the maximum of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"mean\" href=\"#mean\"\u003e#\u003c/a\u003e arr.\u003cb\u003emean\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/mean.js)\n\nReturns the mean of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"meanroll\" href=\"#meanroll\"\u003e#\u003c/a\u003e arr.\u003cb\u003emeanroll\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e, [, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/meanroll.js)\n\nFor each item in an \u003ci\u003earray\u003c/i\u003e of values, calculates the trailing rolling average of \u003ci\u003en\u003c/i\u003e items. If the index of the item is less than n, calculates the avereage of the item's value and all previous values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function.\n\n\u003ca name=\"median\" href=\"#median\"\u003e#\u003c/a\u003e arr.\u003cb\u003emedian\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/median.js)\n\nReturns the median of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"min\" href=\"#min\"\u003e#\u003c/a\u003e arr.\u003cb\u003emin\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/min.js)\n\nReturns the minimum of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"minIndex\" href=\"#minIndex\"\u003e#\u003c/a\u003e arr.\u003cb\u003eminIndex\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/minIndex.js)\n\nReturns the index of the minimum of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"mode\" href=\"#mode\"\u003e#\u003c/a\u003e arr.\u003cb\u003emode\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/mode.js)\n\nReturns the mode or modes, represented as an array of numbers, of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity). If there is no mode, returns undefined.\n\n\u003ca name=\"sum\" href=\"#sum\"\u003e#\u003c/a\u003e arr.\u003cb\u003esum\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/sum.js)\n\nReturns the sum of an \u003ci\u003earray\u003c/i\u003e. You can map each item in the array to the value returned by an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).\n\n\u003ca name=\"variance\" href=\"#variance\"\u003e#\u003c/a\u003e arr.\u003cb\u003evariance\u003c/b\u003e(\u003ci\u003earray\u003c/i\u003e[, \u003ci\u003eaccessor\u003c/i\u003e]) · [Source](https://github.com/HarryStevens/arraygeous/tree/master/src/variance.js)\n\nReturns the [variance](https://en.wikipedia.org/wiki/Variance) of an \u003ci\u003earray\u003c/i\u003e of values. You can map each item in the array to a value with an optional \u003ci\u003eaccessor\u003c/i\u003e function. Ignores invalid values (null, undefined, NaN, Infinity).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrystevens%2Farraygeous","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharrystevens%2Farraygeous","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrystevens%2Farraygeous/lists"}