Support plugin system in Node.js

501 views
Skip to first unread message

Shao Tian

unread,
Feb 2, 2015, 8:47:26 PM2/2/15
to nod...@googlegroups.com
Is there any way to implement plugin system in Node.js like the one in Atlassian JIRA?
For example, I may have a main page for displaying all the plugins. Each plugin is like an independent web app, containing both html and node.js backend code. 
If I select one plugin in the main page, the main page is able to render the html of corresponding plugin, and all the http requests from the plugin html are
handled by the node.js code of the plugin. Thus the main page is just a container of bunch of plugins.
 
I know that with npm we can have modules, but I thought modules can contain only javascript code? what about html, static files like images?

Thanks very much for the help!

zladuric

unread,
Feb 3, 2015, 1:49:58 AM2/3/15
to nod...@googlegroups.com
Of course you can, it's just the question of how integrated you want it to be.

Take a look at mean.io project, as far aI remember, they had just that.

There are others, too, and you can build your custom plugins for your architecture.

Depends a bit oh what you have right now and what exactly you want.

Ryan Schmidt

unread,
Feb 3, 2015, 12:55:57 PM2/3/15
to nod...@googlegroups.com

On Feb 2, 2015, at 7:47 PM, Shao Tian wrote:
>
> Is there any way to implement plugin system in Node.js like the one in Atlassian JIRA?

I am not familiar with Atlassian JIRA...

> For example, I may have a main page for displaying all the plugins. Each plugin is like an independent web app, containing both html and node.js backend code.
> If I select one plugin in the main page, the main page is able to render the html of corresponding plugin, and all the http requests from the plugin html are
> handled by the node.js code of the plugin. Thus the main page is just a container of bunch of plugins.
>
> I know that with npm we can have modules, but I thought modules can contain only javascript code? what about html, static files like images?

It's not node's job to do any of that. You can certainly use node to program a web framework that supports plugins -- or someone else may already have done so (search npm) -- but node itself is not a web framework and does not include such functionality.

Shao Tian

unread,
Feb 3, 2015, 1:24:26 PM2/3/15
to nod...@googlegroups.com
Thanks very much!
Are you referring to the package concept of mean.io?

Zlatko Đurić

unread,
Feb 3, 2015, 9:03:30 PM2/3/15
to nod...@googlegroups.com
Yes, that's what I was talking about. That's the closest thing to plugin-like architecture that I can think of. I'm pretty sure that there are others, though.

For example, sails.js is a framework with lots of stuff out of the box, but also has adapters and stuff for different purposes. But I think mean.io has more complete 'package' system for plugins.

I personally like to work on bare express, as I always tend to customize heavily - and mean.io and others are excellent as long as you stick to the pattern.

So if you plan to deploy lots of "simpler" features, that may be the way to go. If you want to customize a lot, to optimize, to make the app perfect for your use case, I would go with something a bit less "magic" and more extendable.


--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/nnDSRJFSJt0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/6353ed40-5a95-4122-9dac-d825239ca465%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Zlatko

Alexej Yaroshevich

unread,
Feb 3, 2015, 10:31:18 PM2/3/15
to nod...@googlegroups.com
I would suggest something like https://github.com/c9/architect or https://github.com/zxqfox/pym/blob/master/README.md depends on needs.

Shao Tian

unread,
Feb 4, 2015, 12:49:19 PM2/4/15
to nod...@googlegroups.com
Thanks a lot for the explaination!
Reply all
Reply to author
Forward
0 new messages