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

funcpack

v1.0.0

Published

This package provide functions to simplify your code.

Downloads

2

Readme

What is this

This package provide functions to simplify your code.

Installation

npm i funcpack

Importing

const Funcpack=require('funcpack');

Available Functions

chunk

Divides the array into blocks of given number and return it.

let result =Funcpack.chunk(['a', 'b', 'c', 'd'], 2)
//=> [["a", "b"], ["c","d"]]

compact

Creates an array with all falsy values removed. The values false, null, 0, "", undefined, and NaN are falsy.

let result=Funcpack.compact([0, 1, false, 2, '', 3]);
// => [1, 2, 3]

defer

Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to func when it's invoked.

Funcpack.defer(function(text) {
  console.log(text);
}, 'deferred');
// => Logs 'deferred' after one millisecond.

drop

Creates a slice of array with n elements dropped from the beginning.

Funcpack.drop([1, 2, 3]);
// => [2, 3]
Funcpack.drop([1, 2, 3], 0);
// => [1, 2, 3]

####fill Fills elements of array with value from start up to, but not including, end.

var array = [1, 2, 3];
 Funcpack.fill(array, 'a');
console.log(array);
// => ['a', 'a', 'a']

head

Gets the first element of array.

Funcpack.head([1, 2, 3]);
// => 1

rest

Funcpack.rest('hello', 'fred', 'barney', 'pebbles');
// => 'hello fred, barney, & pebbles'

some

Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate returns truthy. The predicate is invoked with three arguments: (value, index|key, collection).

Funcpack.some([null, 0, 'yes', false], Boolean);
// => true

tail

Gets all but the first element of array.

Funcpack.tail([1, 2, 3]);
// => [2, 3]

take

Creates a slice of array with n elements taken from the beginning.

Funcpack.take([1, 2, 3]);
// => [1]

Funcpack.take([1, 2, 3], 2);
// => [1, 2]

zip

Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.

Funcpack.zip(['a', 'b'], [1, 2], [true, false]);
// => [['a', 1, true], ['b', 2, false]]