Skip to content

A JS library to select, transform and format data, declaratively.

License

Notifications You must be signed in to change notification settings

hellonarrativ/composable-js

This branch is 7 commits ahead of vail130/composable-js:master.

Folders and files

NameName
Last commit message
Last commit date
Sep 22, 2017
Feb 15, 2016
Sep 22, 2017
Jan 8, 2016
May 17, 2015
Jan 8, 2016
Feb 15, 2016
Feb 15, 2016
Jan 8, 2016
Aug 11, 2016
Sep 22, 2017
Sep 22, 2017
Sep 22, 2017
Aug 11, 2016

Repository files navigation

Build Status

Composable

A JS library to select, transform and format data, declaratively.

Example

<div id="fixture">
    <input type="text" name="a" value="1">

    <div class="test-div" id="test-div1">Test Div 1</div>
    <div class="test-div" id="test-div2">Test Div 2</div>
    <span class="test-span" id="test-span1">Test Span 1</span>
    <span class="test-span" id="test-span2">Test Span 2</span>
</div>

<script>
    window.testData = {
        test1: [1, 2, 3],
        test2: {
            a: 1,
            b: 2,
            c: 3
        },
        test3: 11
    }
</script>
var data = window.Composable({
    divNumber: [
        'document',
        'querySelector:#test-div1',
        'innerText',
        'match:/\\d/',
        'getIndex:0',
        'toInt'
    ],
    testValue: [
        'window',
        'getProperties:testData.test1.1',
    ]
});

data.divNumber === 1; // true
data.testValue === 2; // true

Install and Test

make install
make test

About

A JS library to select, transform and format data, declaratively.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 88.6%
  • HTML 5.3%
  • Shell 4.6%
  • Makefile 1.5%