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

ffffff

v0.0.6

Published

A simple set of utilities to help with building assembly lines in JS.

Downloads

19

Readme

Assembly Line a.k.a. ffffff

A simple set of utililties, to help with building assembly lines in JS.

The Why

  • Assembly lines help in implementing complex flows, in a manner -- easy to comprehend and maintain.
  • Considerably improves readability.
  • Allows for a hybrid-approach, by bringing together concepts from FP and Non-FP patterns.

Example

/* Process a list of orders with a flow. */
feed(Orders, flow(
	verifyStock,
	verifyPayment,
	dispatch,
	sendMail,
));

For more examples, check the examples dir.

# Or run the following (with node v8+):
$ node ./examples/cheatsheet.js

Installation

$ npm install ffffff

Use Cases

  • Data pipelines.

  • Asset pipelines.

  • Complex and ever-changing business flows.

Keys

  • Simple functions are stiched together to compose complex flows.

  • The same object is passed to all the functions in a flow, as the only argument.

  • Returning false from a function, affects the flow of the all downstream functions. Utility functions help in deciding on, how the flow is affected.

Notes

  • The name flow, is a delibarate choice, to prevent confusing them with traditional pipes.

  • Assembly lines are similar to unix pipes, builder pattern and the pipe-filter pattern from functional languages. Yet, there are some key differentiators:

    • Assembly lines feed the same entity to all the functions in a flow. They do not feed their return values downstream (like pipes / pipes-and-filters).

    • Builder pattern has a specific purpose, building a complex object; where as assembly lines are meant to be a generic pattern in managing complex flows, which might include the building of complex objects.

  • When a flow looks complex, break it into sub-flows.

  • The library doesn't have any dependencies.

  • The package name ffffff represents the primary utilitiy functions of the library. The lack of availability of the name -- assembly-line, al-js and their likes -- with NPM played a part in choosing such an odd name. There are a few more reasons to the name:

    • False plays a key role in controling the flow.

    • The lib is all about functions.

    • All the key functions start with the letter, F.

    • And ffffff is also the hex code of white.

Development

Setup

$ sh ./setup.sh

ToDo

  • Support async flows to process items parallelly.

  • Write some examples and include a few of them in the ReadMe.

  • Add some example bots. Especially, a batcher, a timer and an apiFetcher.

  • Port the package to other languages, esp. to Python.

  • If possible, write tests for the cheatsheet example.

  • Document the API.