Coder Social home page Coder Social logo

fairmont's Introduction

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.

fairmont's People

Contributors

dyoder avatar maheshyellai avatar automatthew avatar lancelakey avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.