npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

retsu

v3.0.2

Published

Array micro library focused on speed

Downloads

106

Readme

retsu

Retsu is an Array library for Client or Server, focused on speed & providing useful functions.

build status

API

add(obj, arg)

Adds arg to obj if it is not found in obj

binIndex(obj, arg)

Performs a binary search on obj (must be sorted) for arg

cast(obj[, keys])

Returns an Object ( NodeList, etc. ) as an Array; if keys is true you will get the keys of the Object

chunk(obj, size)

Transforms an Array to a 2D Array of chunks

clear(obj)

Clears an Array without destroying it

clone(obj)

Clones an Array, shallow defaults to true

compact(obj[, diff])

Compacts a Array by removing null or undefined indices; returns null if diff is true and there is no difference

count(obj, arg)

Counts the occurrence of arg in obj

diff(obj1, obj2)

Finds the difference between two Arrays

each(obj, fn[, ctx])

Iterates obj and executes fn with arguments [value, index]; returning false from fn halts iteration

empty(obj)

Determines if an Array is empty

equal(obj1, obj2)

Determines if two Arrays are equal

fill(obj, arg[, start, offset])

Fills obj with the evalution of arg, optionally from start to offset

flat(obj)

Flattens a 2D Array

intersect(obj1, obj2)

Finds the intersections between two Arrays

iterate(obj, fn)

Iterates an Array using an Iterator

iterator(obj)

Creates an Array generator to iterate the indices

last(obj[, offset])

Returns the last index of the Array, with an optional offset from the end to retrieve a range

limit(obj, start, offset)

Returns a limited range of indices from the Array

max(obj)

Finds the maximum value in an Array

mean(obj)

Finds the mean of an Array

median(obj)

Finds the median value of an Array

merge(obj1, obj2)

Merges obj2 into obj1, excluding duplicate indices

min(obj)

Finds the minimum value in an Array

mingle(obj1, obj2)

Mingles Arrays and returns a 2D Array, corresponding index positions are paired

mode(obj)

Finds the mode value of an Array

range(obj)

Finds the range of the Array

remove(obj, start, end)

Removes indices from an Array without recreating it

replace(obj1, obj2)

Replaces the contents of obj1 with obj2

series(start, end[, offset])

Generates a series Array

sort()

Sorts the Array by parsing values, to be used with [].sort()

sorted(obj)

Sorts obj using sort

spread(obj, arg)

Spreads an Array by divisor arg, e.g. retsu.spread(new Array(100), 21)

stddev(obj)

Finds the standard deviation of an Array

sum(obj)

Gets the summation of an Array

unique(obj)

Returns an Array of unique indices of obj

variance(obj)

Finds the variance of an Array

License

Copyright (c) 2017 Jason Mulligan Licensed under the BSD-3 license.