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

musejs

v1.0.2

Published

![](/assets/logo.png)

Readme

Muse

MIT License Current Version

Getting started


import {
  map,
  filter,
  ...
} from 'musejs';

Utils

map

Higher order map


map([1, 2, 3, 4], i => i + 1)
// => [2, 3, 4, 5]

filter

Higher order filter


filter([1, 'hey', '3', 4], !isNaN);
// => [1, 3, 4]

reduce

Higher order reduce


reduce([1, 2, 3, 4], (i, j) => i + j);
// => 10

foreach

Higher order forEach


forEach([1, 2, 3, 4], i => console.log (i))
// => 1
// => 2
// => 3
// => 4

reverse

Higher order reverse


reverse([1, 2, 3])
// => [3, 2, 1]

id

Return true if the value is not 0, undefined or null


filter([1, null, 4, undefined, 'Hello'], id)
// => [1, 4, 'Hello']

complement

Negates a function


let isNumber = complement(isNaN);
isNumber(1)
// => true

range

Yields a range from min to max by step


[...range(0, 10)]
// => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

times

Performs an action n times


times(3, () => console.log ('Hello'))
// => Hello
// => Hello
// => Hello

flatten

Flatten an array


flatten([1, 2, 3, [4, [5, [6, [7, [8, 9]]]]]])
// => [1, 2, 3, 4, 5, 6, 7, 8, 9]

partial

Take a function fn and an array of args with empty spaces and returns a partial function g that take a single arg


let rgb = (r, g, b) => [r, g, b];
let varyGreen = partial(rgb, 4, null, 5);

varyGreen(4)
// => rgb(4, 4, 5);

thread

Pass a value to a list of function, one function at a time

thread(
  1,
  i => i + 1,
  i => i - 2
)
// => -1

compose

Return a function that takes a value to be threaded in a list of functions


add3AndMultiply3 = compose(add3, multiply3);
add3AndMultiply3(3);
// => 18

promisify

Transform a callback style function into a Promise style function

let readfile = promisify(fs.readFile)

let text = readfile('./test.txt')
text.then(console.log.bind(console))

isNumber, isArray, isString, isObject

Primitives type checking functions


isNumber('3')
// => true

isString('Hello')
// => true

isArray({name: guillaume})
// => false

Math

dotProduct

Dot product between 2 vectors


dotProduct([1, 2, 3], [4, 5, 6]);
// => 32

addMatrix

Matrix/vector addition


addMatrix(
  [[1, 1, 1, 1],
   [1, 1, 1, 1]],

  [[1, 1, 1, 1],
   [1, 1, 1, 1]]
)
// => [[2, 2, 2, 2], [2, 2, 2, 2]]

getRow

Returns a matrix row as a vector


getRow(
  [[1, 1, 1, 1, 1],
   [2, 2, 2, 2, 2],
   [1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1]],
  1
)
// => [2, 2, 2, 2, 2]

getColumn

Returns a matrix column as a vector


getColumn(
  [[2, 1, 1, 1, 1],
   [2, 1, 1, 1, 1],
   [2, 1, 1, 1, 1],
   [2, 1, 1, 1, 1]],
   0
)
// => [2, 2, 2, 2, 2]

multMatrix

Performs a matricex multiplication

const m1 = [
  [1, 2, 3],
  [4, 5, 6]
];
const m2 = [
  [7, 8],
  [9 , 10],
  [11, 12]
]
multMatrix(m1, m2)
// => [ [58, 64],
//      [139, 154]]

matrixDimensions

Returns a matrix dimensions [rows, columns]


const [rows, columns] = matrixDimensions(myMatrix);

transpose

Transpose a matrix


console.log (transpose([
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9]
]))
// => [   [ 1, 4, 7 ],
//        [ 2, 5, 8 ],
//        [ 3, 6, 9 ]   ]