Trine is “the library modern JavaScript doesn’t deserve, but needs right now,” at least according to its GitHub description.
As Finnish developer Jussi Kalliokoski puts it, Trine is a utility library geared at tapping the full potential of functional programming in JavaScript. Kalliokoski explains that despite functional programming improvements introduced in both ECMAScript 5 and 6, the functional style and syntax are still awkward.
Trine is designed as a completely modular and decoupled library in the mold of JavaScript tools such as the lodash utility, Underscore library and Ramda functional library. Each exposed function in Trine exists in its own module for easier transference of functions to the client.
“At this point, you should be asking yourself: ‘Why yet another utility library?’ And you’d be right in asking so,” Kalliokoski writes. “Ramda argues that lodash and Underscore put the data in the wrong place: at the first parameter of the function, while it should be at the last position. They’re both (subjectively) wrong: the natural place for data in JS is the ‘this’ parameter.”
The library extracts many of the functional programming features and concepts included in ES5 and ES6, and presents them in a more practical, uncomplicated context. Trine details built-in JavaScript features such as function bind syntax, iterators and flexible abstraction, infinite sets, and modules in applicable functional programming scenarios.
Trine is available for installation on npm.
Top 5 projects trending on GitHub this week
#1: Docker Jumpstart: A quick introduction to the Docker application container platform going over boot2docker, images, containers, creating Docker Images, building images with Dockerfiles, and sharing images on Docker Hub, among other resources.
#2: Knwl.js is a JavaScript library that parses through text for dates, times, phone numbers, e-mails, locations and other parameters.
#3: Aerosolve is a machine-learning package built for humans by the folks at Airbnb.
#4: AppIntro is an Android library to create a cool introductory screen and graphic for your app.
5#: Tmux is the source code for the Tmux terminal multiplier.