Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fairmont

Package Overview
Dependencies
Maintainers
3
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fairmont

A collection of useful functions and utilities.

  • 1.0.0-beta-10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.2K
increased by90.99%
Maintainers
3
Weekly downloads
 
Created
Source

Fairmont

A collection of useful JavaScript functions to support a functional style of programming that takes advantage of ES6 features like iterators, generators, and promises. Fairmont is inspired by Underscore, EssentialJS, and prelude.coffee.

Why Fairmont?

Fairmont offers a combination of features we couldn't find in existing libraries. In particular, we wanted:

  • To use a functional programming style, even when performing asynchronous operations…

  • While coming as close to inline code for performance as possible (read: use lazy evaluation when working with collections)…

  • Taking full-advantage of ES6 features like iterators, generators, and promises, which offer powerful new ways of doing things

For example, here's how we would define a function that takes a path and returns a content-addressable dictionary of the files it contains.

content_map = async (path) ->
  paths = collect map (compose resolve, join path), yield readdir path
  assoc zip (map (compose md5, read), paths), paths

We've seamlessly integrated asynchronous functions with synchronous functions, even when doing composition. Behind the scenes we're using iterators to avoid multiple passes across the data. We make two passes here, even though it appears that we're making five.

Fairmont is also a literate programming project—the documentation, code, examples, and tests are together, making it easy to see what a function does, how it does it, and why it does it that particular way.

Function Reference

Status

Fairmont is still under heavy development and is beta quality, meaning you should probably not use it in your production code.

Roadmap

You can get an idea of what we're planning by looking at the issues list. If you want something that isn't there, and you think it would be a good addition, please open a ticket.

Keywords

FAQs

Package last updated on 25 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc