Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
arraygeous
Advanced tools
Readme
A JavaScript library for lightning fast array manipulation.
In vanilla, a arr
global is exported. You can use the latest version from unpkg.
<script src="https://unpkg.com/arraygeous@0.1.24/build/arraygeous.js"></script>
<script src="https://unpkg.com/arraygeous@0.1.24/build/arraygeous.min.js"></script>
If you'd rather host it yourself, download the latest release from the build
directory.
npm i arraygeous -S
const arr = require("arraygeous");
arraygeous provides three types of functions.
You can also call multiple functions on the same array by using arr.pipe(array). Return the result of the pipe with pipe.result().
# arr.every(array, test) · Source
Returns a boolean representing whether every item in an array passes a test function.
# arr.filter(array, test) · Source
Returns a new array with every element in an array that passes a test, specified as a function.
# arr.find(array, test) · Source
Returns the value of the first element in an array that passes a test, specified as a function.
# arr.findIndex(array, test) · Source
Returns the index of the first element in an array that passes a test, specified as a function. Returns -1 if no element passes the test.
# arr.includes(array, value[, start]) · Source
Returns a boolean representing whether an array includes a value. You can specify where in the array to begin the seach with an optional start index.
# arr.map(array, accessor) · Source
Returns a new array with the result of calling an accessor function for each array element.
# arr.some(array, test) · Source
Returns a boolean representing whether any item in an array passes a test function.
# arr.closest(array, value[, accessor]) · Source
Returns the closest element in an array to a value, ignoring invalid values (null, undefined, NaN, Infinity) in the array. The array can be mapped to an optional accessor function.
# arr.count(array[, accessor]) · Source
Returns an array of objects, where each object represents a unique value from an input array, according to an optional accessor function, and the number of items that value appears in the array.
# arr.flatten(array[, accessor]) · Source
Returns a single array from an array of arrays. You can map each item in the array to the value returned by an optional accessor function.
Returns a random item from an array.
# arr.sort(array[, accessor[, order]]) · Source
Sorts an array. You can map each item in the array to the value returned by an optional accessor 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.
# arr.unique(array[, accessor]) · Source
Returns the unique values of an array. You can map each item in the array to the value returned by an optional accessor function.
# arr.cor(array[, x, y]) · Source
Returns the correlation coefficient of an array 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 x- and y-accessor functions.
# arr.cumsum(array[, accessor]) · Source
Returns the iterated cumulative sum of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.deviation(array[, accessor]) · Source
Returns the standard deviation of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.diff(array[, accessor[, lag]]) · Source
Returns lagged and iterated differences of an array of values. You can map each item in the array to a value with an optional accessor function. You can pass a third a third argument, lag, which is an integer indicating how many indices back to calculate the lag
# arr.extent(array[, accessor]) · Source
Returns the minimum and maximum, represented as [minimum, maximum], of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.max(array[, accessor]) · Source
Returns the maximum of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.maxIndex(array[, accessor]) · Source
Returns the index of the maximum of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.mean(array[, accessor]) · Source
Returns the mean of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.meanroll(array, n, [, accessor]) · Source
For each item in an array of values, calculates the trailing rolling average of n 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 accessor function.
# arr.median(array[, accessor]) · Source
Returns the median of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.min(array[, accessor]) · Source
Returns the minimum of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.minIndex(array[, accessor]) · Source
Returns the index of the minimum of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.mode(array[, accessor]) · Source
Returns the mode or modes, represented as an array of numbers, of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity). If there is no mode, returns undefined.
# arr.sum(array[, accessor]) · Source
Returns the sum of an array. You can map each item in the array to the value returned by an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
# arr.variance(array[, accessor]) · Source
Returns the variance of an array of values. You can map each item in the array to a value with an optional accessor function. Ignores invalid values (null, undefined, NaN, Infinity).
FAQs
A JavaScript library for lightning fast array manipulation.
The npm package arraygeous receives a total of 42 weekly downloads. As such, arraygeous popularity was classified as not popular.
We found that arraygeous demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.