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

immootable

v0.4.0

Published

```js /** * Example */ // import createReducer from '../create-reducer' import {append, combine, get, set} from 'immootable'

Downloads

6

Readme

Immootable

/**
 * Example
 */
// import createReducer from '../create-reducer'
import {append, combine, get, set} from 'immootable'

// user -> id
const getUserId = get(['user', 'id'])
// user -> state -> state
const addUserToState = user => set(['users', getUserId(user)])
// user -> state -> state
const addUserIdToList = user => update(
  'list',
  // list -> list
  pipe(append, getUserId(user))
)

const actions = {
  ADD_USER: (state, {payload: { user }}) => {
    const action = combine(
      addUserIdToList(user),
      addUserToState(user)
    )
    return action(state)
  }
}

export default createReducer(actions, {list: [], users: {}})

API

append

import {append} from 'immootable'

const input = ['a', 'b']
const appendC = append('c')
appendC(input) // ['a', 'b', 'c']

apply

import {apply} from 'immootable'

const add = (a, b) => a + b
apply(add, [1, 2]) // 3

combine

import {combine} from 'immootable'

const add1 = val => val + 1
const divide2 = val => val/2
const foo = combine(add1, divide2)
foo(2) // 2; first divides then adds

curry

Allow currying values for a given function

function -> function

import {curry} from 'immootable'

const add = curry((a, b) => a + b)
const add1 = add(1)
add1(3) // 4

defaultTo

Returns default value when target value is falsy

defaultValue -> targetValue -> output

import {defaultTo} from 'immootable'

defaulTo('foo', 1) // 1
defaulTo('foo', 0) // 'foo'
defaulTo('foo', null) // 'foo'
defaulTo('foo', undefined) // 'foo'

get

Returns the value of an Object|Array given a path or a key|index

key|index|Array<key> -> Object|Array -> any

import {get} from 'immootable'

get(0, ['a', 'b']) // 'a'
get([0, 1], [['a', 'b'], 'c']) // 'b'
get(['a', 'b'], { a: { b: 'foo' } } ) // 'foo'
get(['a', 'b'], { aa: { bb: 3 } } ) // undefined

has

Checks if the value pointed by a path is not undefined

key|index|Array<key> -> Object -> Boolean

import {has} from 'immootable'

has(['a', 'b'], { a: { b: 'foo' } } ) // true
has(['aa', 'b'], { a: { b: 'foo' } } ) // false
const named = has('name')
named({name: 'f', age: 1}) // true

insert

index -> value -> list -> list

import {insert} from 'immootable'

const list = ['a', 'c']
insert(1, 'b', list) // ['a', 'b', 'c']

log

Logs the second argument and returns it

Function -> any -> any

import {log} from 'immootable'
const parser = x => `count: ${x}`
const logCount = log(parser)

const add4 = pipe(
  add1,
  add1,
  log,
  add1,
  add1
)
add4(0) // 4
// count: 2

omit

(key|Array<key>) -> (Object|Array) -> (Object|Array)

import {omit} from 'immootable'
// with arrays
const cutthroat = omit(0)
cutthroat(['a', 'b', 'c']) // ['b', 'c']

// with objects
const anonymous = omit(['name', 'id'])
anonymous({ name: 'moo', id: 42, foo: true }) // { foo: true }

passBy

Allows you to introduce side effects in a pipe.

function -> value -> value

import {passBy} from 'immootable'

const getUserName = combine(
  getName,
  passBy(console.log), // will log the output of getUser and return it
  getUser
)

pipe

import {pipe} from 'immootable'
const getUserId = pipe(
  getUser,
  getId
)
getUserId({ user: { id: 'id' } }) // 'id

prepend

value -> list -> list

import {prepend} from 'immootable'
const list = ['b', 'c']
prepend('a', list) // ['a', 'b', 'c']

reverse

import {reverse} from 'immootable'
const list = ['b', 'c']
reverse(list) // ['c', 'b']

set

import {set} from 'immootable'

const setNick = set('nick')
const input = {repos: [], nick: ''}
const output = setNick('moo', input) // {repos: [], nick: 'moo'}
ouput.repos === input.repos // true
output === input // false

const house = {door: { isOpen: true } }
const closeDoor = set(['door', 'isOpen'], false)
closeDoor(house) // {door: { isOpen: false } }

update

import {update} from 'immootable'

const switchDoor = update(
  ['door', 'isOpen'],
  (isOpen) => !isOpen
)
const house = {door: { isOpen: true } }
switchDoor(hosue) // {door: { isOpen: false } }

Composable functions

Every method exposed allows currying their arguments*. *(except curry, pipe and combine)