2022.10.10 • Published 2 years ago

@combined/konfiguroida v2022.10.10

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Konfiguroida

Confiture (Finnish konfiguroida) with whole fruits - data oriented programming for configuration and friends.

License: MIT

npm version npm

Documentation

User and developer documentation of konfiguroida.

Bug Tracker

Feature requests and bug reports are bested entered in the todos of konfiguroida.

Primary Source repository

The primary source of konfiguroida lives somewhere on a mountain in Central Switzerland. But, we use decentralized version control (git), so any clone can become the source to everyone's benefit, no central only code. Anyway, the preferred public clones of konfiguroida are:

  • on codeberg - a democratic community-driven, non-profit software development platform operated by Codeberg e.V.
  • at sourcehut - a collection of tools useful for software development.

Installation

# using npm
❯ npm install konfiguroida

# using yarn
❯ yarn add konfiguroida

Usage

// using require
const { cook, partial } = require('konfiguroida')

// using import
import { cook, partial } from 'konfiguroida'

Example

// Some population to sample from:
const FRUITS = ['apples', 'currants', 'oranges', 'peaches', 'pears']

// Preparing the kitchen for cooking confitures from diverse fruits:
const cookFrom = partial(cook, FRUITS)
const cookFromFruits = partial(cookFrom, 'fruits')
const cookFromFruitsConfiture = partial(cookFromFruits, 'confiture')

// Cook the confitures:
const confitures = cookFromFruitsConfiture([
  [{size: 'XXS'}, ['currants']], 
  [{size: 'XXL'}, null]
])
console.log(confitures)
//[
//  { confiture: { size: 'XXS' }, fruits: [ 'currants' ] },
//  {
//    confiture: { size: 'XXL' },
//    fruits: [ 'apples', 'oranges', 'peaches', 'pears' ]
//  }
//]

Status

Experimental.

Note: The default branch is default.