# smallfoot

> Smallfoot.js is a minimalist library for functional programming, with small footprint.

Latest version **0.0.4** (published 2016-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install smallfoot
pnpm add smallfoot
yarn add smallfoot
bun add smallfoot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2016-04-01 |
| First published | 2016-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Szilveszter Szilagyi |
| Maintainers | szilveszter9 |
| Keywords | functional, programming, minimalist, small, footprint |

## Links

- npm: https://www.npmjs.com/package/smallfoot
- npm.io page: https://npm.io/package/smallfoot

## Dependencies (2)

- [exorcist](https://npm.io/package/exorcist.md) ^0.4.0
- [browserify](https://npm.io/package/browserify.md) ^13.0.0

## Recent versions

- 0.0.4 (latest) — 2016-04-01
- 0.0.3 — 2016-02-12
- 0.0.2 — 2016-02-12

## README

# Smallfoot.js #

Description
===========
Smallfoot.js is a minimalist library for functional programming, with small footprint.

Github
======
https://github.com/szilveszter9/smallfoot.js

Examples
========
* For more examples see: play.js at https://github.com/szilveszter9/smallfoot-sandbox
* Get a DOM element, read it's innerHTML, make it uppercase, and log that. (Read it from bottom to top.)
```javascript
var app = l.compose(
  l.log.value,
  l.string.upper,
  l.object.getValue('innerHTML'),
  l.dom.getDomElement
);

app('#mydiv');
```
* Request JSON data and inject it into a template. (Read the compose from right to left.)
```javascript
var userTemplate = l.template.set('<div class="avatar">{{login}}<img src="{{avatar_url}}"/></div>');
var url = "https://api.github.com/repos/mozilla/kuma/contributors";
var userTemplates = l.compose(l.map(userTemplate), l.http.getResponseJSON);
var usersTemplate = l.compose(l.array.toString, userTemplates);
var eitherUsersTemplate = l.compose(l.Either('could not generate the template'), l.array.toString, userTemplates);
function app(){
  var setMydiv = getElSetHtml('#mydiv');
  var showUsers = l.compose(l.map(setMydiv), eitherUsersTemplate);
  l.http.get(showUsers)(url)();
}

app();
```


NPM
===
https://www.npmjs.com/package/smallfoot

Installation
============
npm install smallfoot

Contribution
============
Bug fixes, docs and examples are welcomed.

You can start with smallfoot-sandbox, see https://github.com/szilveszter9/smallfoot-sandbox
```shell
git clone https://github.com/szilveszter9/smallfoot.js
git clone https://github.com/szilveszter9/smallfoot-sandbox
cd smallfoot-sandbox
npm install
npm link ../smallfoot.js
npm run dev
npm start
```

---
_Source: https://npm.io/package/smallfoot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
