Chasten
Table of contents
Introduction
Chasten is an unabashedly opinionated collection of libraries that provide a simple foundation upon which Node.js web applications can be built. It is a set of building blocks that help you write web applications in a style heavily inspired by and not altogether incongruent with functional programming despite the inherent obstacles presented by Node.js and JavaScript.
Chasten resides in the same general area as a number of more popular and proven NPM libraries, but it seems doubtful there can be any genuine rivalry. Most of the packages that Chasten ostensibly contends with are completely incompatible with pure functional programming and Chasten, in turn, makes no attempt to be compatible with them.
Why would anyone pick Chasten over Express et al, then? Because functional programming is fundamentally the right way to build web applications, and Chasten helps make it possible and even somewhat convenient to do so. See the rationale for an explanation of why functional programming fits web development so well.
Rationale
The short version: Functional programming without side effects and mutation in the application code is fundamentally the right way to build software and in particular web applications. All impure code should be confined to its own section, which can be called upon in a purely functional manner by the rest of the code base. Read the full rationale for the much longer version, which goes into details and examples. The documentation for prithee explains how you can get any real work done under these constraints.
Libraries
The major components of Chasten are provided as independent libraries, available from NPM.
parfay (NPM) is a handful of higher-order functions that helps you turn your pure functions into something that Node.js can use.
Read the conceptual introduction, which covers most of the basic concepts of Chasten.
Confer the API reference.
prithee (NPM) provides a means of keeping application code purely functional while also dealing with effects and coeffects.
Read the conceptual introduction.
Confer the API reference.
whither (NPM) provides HTTP request routing capabilities based on URL and method.
Read the conceptual introduction.
Confer the API reference.
Getting Started
There are a number of ways to get started with Chasten depending on learning preferences.
- Read about the libraries. Start with Parfay's conceptual introduction if in doubt.
- Read the rationale for creating Chasten.
- Problems or questions? Create an issue on GitLab.