Baseline is a JavaScript library that provides useful helpers for everyday, low-level tasks missing from the core language. This livespec is running Baseline , and is built as a Proot app – since Baseline is JavaScript, and writing interfaces with JavaScript is so easy in Proot, I'm composing this documentation dynamically based on the actal library contents.

Baseline resources
Download baseline.js
Project at Bitbucket
Proot
View source for this site
Proot at Bitbucket
Developed by Eiskis
eiskis.net
eiskis@gmail.com

The Baseline library is contained within the global bl object literal. This includes internal configuration hash, and the following main namespaces.

  • %content%

More about namespaces

These are considered set types. Each is referred to with a shorthand that doesn't overlap with JavaScript's reserved words.

Type Possible values Empty when
Boolean (bool) true or false false
Integer (int) 0
Float (float) Any floating point number (including any integer) 0
String (str) ''
Array (array) []
Associative arrays (hash) {}
Function (func) Only when unset

In JavaScript, you have to check for multiple different unset values. Baseline considers all the following values as unset, so you don't have to always check for them manually.

  • undefined
  • null
  • NaN