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 🙏

© 2024 – Pkg Stats / Ryan Hefner

most-adjunct

v1.1.0

Published

## Documentation

Downloads

37

Readme

most-adjunct

Documentation

Note: All functions in most-adjunct are curried.

concatArray

concatArray(arr: Array<Stream>): Stream

Array variant of most.concat, allowing you to concatenate many streams together.

fromEagerPromise

fromEagerPromise(f(): Promise): Stream

The problem with fromPromise is that promises are eager, and therefore it would have already executed prior to being subscribed to. This function creates a lazy stream version of the promise.

fromFuture

fromFuture(future: Future): Stream

Converts a future into a stream.

ignoreElements

ignoreElements(stream: Stream): Stream

Ignore any further elements. Do not emit any more items in this stream. This does not complete the stream.

last

last(stream: Stream): Stream

Emits only the last item emitted on the stream (once the inner stream has completed).

Example:

const stream = most
  .from([1, 2, 3])
  .thru(mA.last);

stream.observe({
  next: console.log,  
});

// -> 3
a:      -1-2-3-|
stream: -----3-|

mapError

mapError(f: (x): any, stream: Stream): Stream

If the stream errors this function will allow you to transform the error (via mapping) without recovering the error (catching).

This is useful in situations whereby you have an underlying internal error that you want to make into a human readable error.

range

range(start: Number, end: Number): Stream

Create a stream of numbers from start to end.

Example:

const stream = mA.range(1, 3);

stream.observe({
  next: console.log,  
});

// -> 1
// -> 2
// -> 3

switchMap

switchMap(f: (x: any): Stream, stream: Stream): Stream

A composition of map + switchLatest. Will automatically subscribe to the inner stream that is mapped out.

tapError

tapError(f(x: any): void, stream: Stream): Stream

The same as most.tap excepts it allows for tapping of items in the error state.

toArray

toArray(stream: Stream): Stream

Accumlates all of the items emitted and emits an array of all of those items.

None of the original items are emitted on this new stream.

Example:

const stream = most
  .from([1, 2, 3])
  .thru(mA.toArray);

stream.observe({
  next: console.log,  
});

// -> [1, 2, 3]

waitUntil

waitUntil(f: (): boolean | Promise<boolean>, interval: number = 500): Stream

Creates a Stream that will only start emitting events when the predecate function returns true.

Example:

waitUntil(() => returnTrueOrFalse(), 1000)
  .map(() => {});