Giter Club home page Giter Club logo

conjoiners-node.js's Introduction

conjoiners - multi-platform / multi-language reactive programming library Build Status

conjoiners is a library aiming to enable reactive programming for existing (or new) systems written in different languages and running on different platforms. conjoiners is minimally invasive in its programming model, but complex behind the scenes.

Idea and first implementations are done by me, Pavlo Baron (pavlobaron).

This is the Node.js implementation. General project description can be found in the conjoiners repository.

How does it work?

conjoiners for Node.js follows the conjoiners simplicity of use an non-invasiveness. In order to add an implant to an object, you call:

var conjoiners = require('conjoiners')
conjoiners.implant(cj1, "../test/test_conf.json", "test");

The first parameter of the implant function is the object itself. The second is the nest configuration file path. The third is the name of this conjoiner that can be found in the configuration.

From here, any time you set a field value in this object, a transenlightenment will be propagated to all known conjoiners. Any time you access a value, it will return the most current one, eventually set through a transenlightenment from other conjoiner. That's basically it.

Internally, conjoiners for Node.js works through monkey patching the object provided to the implant function call. There is also a pretty weird loop implemented through timers in order to observe new properties in the object. This is because it's not possible in ECMAScript to have a generic catch-all setter/getter for any value.

Development

Make sure that you have ØMQ and node.js with NPM installed on your machine.

This project uses a standard node.js module descriptor (package.json) and Grunt as a tool for test execution and static source code analysis. To install the project's dependencies, simply run npm install in the project's root directory. This will make sure that the ØMQ node.js bindings and development tools are locally installed.

To make use of Grunt, you further need to have its CLI tool on your path.

npm install -g grunt-cli

The most useful Grunt tasks currently are nodeunit for test execution, jshint for static source code analysis and watch to run both tasks on every file change. To execute these tasks, simple call Grunt:

grunt nodeunit

conjoiners-node.js's People

Contributors

bripkens avatar pavlobaron avatar crvidya avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.