fiji.js

0.1.0 • Public • Published

Fiji Build Status

Lightweight, clear and simple method for decoupling javascript from templates

Usage

Write your code somewhere and wrap it in a function ready to receive a context object

function myfunction(context) {
    console.log(context);
    console.log(context.choices[0].fields);
    console.log(context.normal);
    console.log(context.plain);
}

Then use fiji to create the context and call your function in your template

fiji({
    poll_id: {'{{poll.pk}}': Number},
    choices: {'{{poll.choice_set.all|jsonify|safe}}': Object},
    normal: {'[1, 2, 3]': Array},
    plain: 'text'
}).run(myfunction);

Readme

Keywords

none

Package Sidebar

Install

npm i fiji.js

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • astagi