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 🙏

© 2026 – Pkg Stats / Ryan Hefner

Mr.Array

v0.1.1

Published

A JavaScript 'Array' object extention. Most of APIs is from C# Enumerable class and JavaScript 1.6 or JavaScript 1.7 Array object methods.

Readme

Mr.Array

Mr.Array is a JavaScript Array Object method extention library. It will help you operate every item in array in LINQ way. And at the same time, the static method invoke is accepted.

Supported APIs

  • select
var source = [{ id : 1, month : 11 }, { id : 2, month : 12 }, { id : 3, month : 13  }];
var idResult = source.select(function(o){ return o.id; });
  • selectMany
var source = [{ a : [1,2,3]}, { a : [4,5,6] }, { a : [7,8,9] }];
var result = source.selectMany(function(o){ return o.a; });
  • toDictionary
var source = [{ name : 'a',  value : [1,2,3] }, { name : 'b',  value : [4,5,6] }, { name : 'c',  value : [7,8,9] }, { name : 'a', value : [10, 11, 12] }];
var result = 
    source.toDictionary(function(obj){
		return obj.name + '_group';
	}, function(obj){
		return obj.value[0];
	});
  • where
var source = [{ id : 1, month : 11 }, { id : 2, month : 12 }, { id : 3, month : 13  }];
var idResult = source.where(function(o){ return o.id > 2; });
  • orderBy
var source = [2, 5, 6, 1, 7, 8, 9, 3, 10, 4];
var result = source.orderBy(function(a,b){ return a - b });
  • groupBy
var source = [{ name : 'Attach'}, { name : 'Charactor'}, { name : 'Bee'}, { name : 'Cycle'}, { name : 'Add'}];
var result = 
    source
	.orderBy(function(a, b){ return a.name.charCodeAt(0) - b.name.charCodeAt(0); })
	.groupBy(function(obj){ return obj.name.charAt(0); });
  • any
var source = [{ name : 'Attach' }, { name : 'Charactor' }, { name : 'Bee' }, { name : 'Cycle' }, { name : 'Add' }];
var result = 
    source.
	any(function(obj){ return obj.name.charAt(0) == 'B'; });
  • all
var source = [{ name : 'Attach' }, { name : 'Charactor' }, { name : 'Bee' }, { name : 'Cycle' }, { name : 'Add' }];
var result = source.all(function(obj){
    return obj.name.length > 3; 
});
  • take
var source = [2, 5, 6, 1, 7, 8, 9, 3, 10, 4];
var result = source.take(3);
  • skip
var source = [2, 5, 6, 1, 7, 8, 9, 3, 10, 4];
var result = source.skip(5);
  • each
var source = [2, 5, 6, 1, 7, 8, 9, 3, 10, 4], i = 0;
source.each(function(val, idx){
    equal(i++, idx);
    equal(source[idx], val);
});
  • reduce_rtl
var source = [2, 5, 6, 1, 7, 8, 9, 3, 10, 4], i = 8;
var result = source.reduce_rtl(function(curr, old, idx, array){
    return curr + old;
});
  • reduce_ltr
var source = [2, 5, 6, 1, 7, 8, 9, 3, 10, 4], i = 1;
var result = source.reduce_ltr(function(curr, old, idx, array){	
    return curr + old;
});
  • except
var source = [{ a : 1, b : 22 }, { a : 2, b : 77 }, { a : 2, b : 2 }, { a : 3, b : 5 }];
var source2 = [{ a : 1, b : 11 }, { a : 2, b : 32 }, { a : 3, b : 30 }, { a : 4, b : 2 }];
var result = source.except(source2, function(curr){ return curr.a == 1 || curr.a == 2; });
  • intersect
var source = [{ a : 1, b : 10 }, { a : 1, b : 10 }, { a : 2, b : 30 }, { a : 1, b : 40 }];
var source2 = [{ a : 1, b : 10 }, { a : 4, b : 20 }, { a : 2, b : 0 }, ];
var result = source.intersect(source2, function(curr, compare){ return curr.a == 1 && curr.b == 10 });
  • union
var source = [2, 2, 4, 4, 8], source2 = [9, 3, 9, 3];
var result = source.union(source2);
  • diff
var source = [2, 2, 1, 10, 3, 9, 4];
var source2 = [1, 10, 20, 4];
var result = source.diff(source2);
  • contains
  • containsAll
  • distinct
var source = [2, 2, 4, 4, 8, 9, 3, 9, 3];
var result = source.distinct();

Example: Group programming languages

// 2011年排行
var langs = [
    'Java', 'C', 'C++', 'C#', 'PHP', 'Python', 'Visual Basic', 'Objective-C', 'Perl', 'JavaScript',
    'Ruby', 'Assembly*', 'Delphi', 'Go', 'Lisp', 'Lua', 'Ada', 'Pascal', 'NXT-G', 'Scheme*',
    'RPG(OS/40)', 'Visual Basic .NET', 'Transact-SQL', 'R', 'Groovy', 'SAS', 'MATLAB', 'ABAP', 'Scratch', 'PL/SQL',
    'Haskell', 'Logo', 'D', 'Object Pascal', 'Fortran', 'Alice', 'Forth', 'COBOL', 'Erlang', 'Bash', 
    'ML', 'MAD', 'APL', 'Scala', 'F#', 'ActionScript', 'Smalltalk', 'C Shell', 'CL(OS/400)', 'Prolog'
];

var result = 
    langs
	.orderBy(function(a, b){ return a.charCodeAt(0) - b.charCodeAt(0); }) // important !!
	.groupBy(function(name){ return name.charAt(0); })
	.select(function(group){
		var obj = {};
		obj[group[0].charAt(0)] = group.orderBy(function(a, b){ return a.length - b.length; });
		return obj;
	});