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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mori-ext

v0.3.0

Published

Function bind syntax for mori

Downloads

10

Readme

mori-ext

Function bind syntax wrappers for mori

immutable data structures + LINQ in javascript

\__   __ \_______ \______   \___         \_______ \__  \__ \_______
|  |_|  ||       ||    _ |  |   |        |       ||  |_|  ||       |
|       ||   _   ||   | ||  |   |  ____  |    ___||       ||_     _|
|       ||  | |  ||   |_||_ |   | |____| |   |___ |       |  |   |  
|       ||  |_|  ||    __  ||   |        |    ___| |     |   |   |  
| ||_|| ||       ||   |  | ||   |        |   |___ |   _   |  |   |  
|_|   |_||_______||___|  |_||___|        |_______||__| |__|  |___|  

thanks http://patorjk.com/software/taag

Quick example

import { vector } from 'mori';
import { assoc, equals } from 'mori-ext';

const v1 = vector('foo', 'bar', 'baz');
const v2 = v1::assoc(1, 'quux');
const v3 = vector('foo', 'quux', 'baz');
v2::equals(v3); // => true

How?

Using babeljs everyone can use this syntax.

Look at an example using gulp

Also, copy the .babelrc file, in order to enable the required language features in babeljs.

This effort is inspired by trine

Installation

npm install --save mori-ext

see https://www.npmjs.com/package/mori-ext

runtime dependencies

mori, babel-runtime,

Usage

Review the spec (the spec is as of this moment not complete, but it's on its way)

API

mori-ext's API is mostly based on collections being the first argument to mori functions, i.e.

import mori from 'mori';
import { equals, isList } from 'mori-ext';

const coll = mori.vector(1, 2, 3);

mori.isList(coll);
// is equivalent to
coll::isList();

// and

mori.equals(coll1, coll2);
// is equivalent to
coll1::equals(coll2);

However, not all functions operate on a single collection, or even, on collections at all, so some consideration has been taken into account, e.g.

import { list, vector, seq } from 'mori';
import { mapcat, cons } from 'mori-ext';
// mapcat
((x, y) => list(x, x + y))
  ::mapcat(seq('abc'), seq('123'));
// => ('a' 'a1' 'b' 'b2' 'c' 'c3')

// cons (converts collection into seq)
1::cons(vector(2, 3))
// => (1 2 3)

Exported values

Fundamentals

equals
hash

Type Predicates

isList
isSeq
isVector
isMap
isSet
isCollection
isSequential
isAssociative
isCounted
isIndexed
isReduceable
isSeqable
isReversible

Collections

list
vector
hashMap
set
sortedSet
range
queue

Collection Operations

conj
into
assoc
dissoc
distinct
empty
get
getIn
hasKey
find
nth
last
assocIn
updateIn
count
isEmpty
peek
pop
zipmap
reverse

Vector Operations

subvec

Hash Map Operations

keys
vals
merge

Set Operations

disj
union
intersection
difference
isSubset
isSuperset

Sequences

first
rest
seq
cons
concat
flatten
intoArray
each
map
mapcat
filter
remove
reduce
reduceKV
take
takeWhile
drop
dropWhile
some
every
sort
sortBy
interpose
interleave
iterate
repeat
repeatedly
partition
partitionBy
groupBy

Helpers

primSeq
identity
constantly
inc
dec
sum
isEven
isOdd
comp
juxt
knit
pipeline
partial
curry
fnil
toClj
toJs