{"id":21184929,"url":"https://github.com/msgflo/msgflo-nodejs","last_synced_at":"2025-07-10T00:34:02.189Z","repository":{"id":33207466,"uuid":"36850152","full_name":"msgflo/msgflo-nodejs","owner":"msgflo","description":"Node.js participant support for MsgFlo","archived":false,"fork":false,"pushed_at":"2020-05-24T16:37:37.000Z","size":415,"stargazers_count":9,"open_issues_count":30,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-02-27T22:05:49.967Z","etag":null,"topics":["amqp","message-passing","mqtt"],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msgflo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-04T05:35:03.000Z","updated_at":"2022-12-21T10:32:50.000Z","dependencies_parsed_at":"2022-08-17T22:15:07.933Z","dependency_job_id":null,"html_url":"https://github.com/msgflo/msgflo-nodejs","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgflo%2Fmsgflo-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgflo%2Fmsgflo-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgflo%2Fmsgflo-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msgflo%2Fmsgflo-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msgflo","download_url":"https://codeload.github.com/msgflo/msgflo-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225606496,"owners_count":17495551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqp","message-passing","mqtt"],"created_at":"2024-11-20T18:14:05.782Z","updated_at":"2024-11-20T18:14:06.474Z","avatar_url":"https://github.com/msgflo.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# msgflo-nodejs [![Build Status](https://travis-ci.org/msgflo/msgflo-nodejs.svg?branch=master)](https://travis-ci.org/msgflo/msgflo-nodejs)\n\n[MsgFlo](https://github.com/msgflo/msgflo) is a distributed, polyglot FBP (flow-based-programming)\nruntime. It integrates with other FBP tools like the [Flowhub](http://flowhub.io) visual programming IDE.\n\nThis library makes it easy to create MsgFlo participants in JavaScript/CoffeScript on node.js.\n\n## Status\n\n**Production**\n\n* Used at [TheGrid](https://thegrid.io) for all workers using AMQP/RabbitMQ,\nincluding in [imgflo-server](https://github.com/jonnor/imgflo-server)\n* Also used by [noflo-runtime-msgflo](https://github.com/noflo/noflo-runtime-msgflo)\n* Experimental support for MQTT and direct transports\n\n## Licence\n\nMIT, see [./LICENSE](./LICENSE)\n\n## Usage\n\nAdd as an NPM dependency\n\n    npm install --save msgflo-nodejs\n\nA simple participant (CoffeeScript)\n\n    msgflo = require 'msgflo-nodejs'\n\n    RepeatParticipant = (client, role) -\u003e\n      definition =\n        component: 'Repeat'\n        icon: 'file-word-o'\n        label: 'Repeats in data without changes'\n        inports: [\n          id: 'in'\n          type: 'any'\n        ]\n        outports: [\n          id: 'out'\n          type: 'any'\n        ]\n      process = (inport, indata, callback) -\u003e\n        return callback 'out', null, indata\n      return new msgflo.participant.Participant client, definition, process, role\n\n    client = msgflo.transport.getClient 'amqp://localhost'\n    worker = RepeatParticipant client, 'repeater'\n    worker.start (err) -\u003e\n      throw err if err\n      console.log 'Worker started'\n\nIf you expose the participant factory function ([examples/Repeat.coffee](./examples/Repeat.coffee))\n\n    module.exports = RepeatParticipant\n\nThen you can use the `msgflo-nodejs` exectutable to start participant\n\n    msgflo-nodejs --name repeater ./examples/Repeat.coffee\n\n## Debugging\n\nmsgflo-nodejs uses the [debug NPM module](https://www.npmjs.com/package/debug).\nYou can enable (all) logging using:\n\n    export DEBUG=msgflo*\n\n## Supporting other transports\n\nmsgflo-nodejs has a transport abstraction layer. So to support a new messaging system,\nimplement `Client` and `MessageBroker` [interfaces](./src/interfaces.coffee).\n\nYou can then pass the Client instance into a `Participant`.\n\nOr you can register a new transport using `msgflo.transport.register('mytransport', myTransportModule)`.\nThen you can get a Client instance using `msgflo.transport.getClient('mytransport://somehost:666')`.\nThis has the advantage of also working when specifying the broker URL using\n`msgflo-nodejs --broker` or `MSGFLO_BROKER=` environment variable.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsgflo%2Fmsgflo-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsgflo%2Fmsgflo-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsgflo%2Fmsgflo-nodejs/lists"}