The QuickConnect Framework for Node.js. Flow control, application controller logic, and so much more!
npm install qcnode
The QuickConnect framework for Node.js is designed to help the developer quickly write, debug, and run asynchronous or synchronous code. The framework encourages code re-use and modularity.
There are many ways!
QuickConnect = QuickConnectvar qc =qc...var stack = qc // .handleRequest === .runstackstack
Um… No I didn't! Pay no attention to the man behind the callbacks! This code gets run top-to-bottom; the callbacks are just helpers.
Well, fine. These examples are actually written in a shorthand that was helpful while writting coffeescript. it looks like this in coffeescript:
qcisolate 'request'->@isolate 'GET'->@command 'contest'->@valcfif + < limit"the contest has not begun"else@STACK_CONTINUE@dcfdataresponsewriteHead 200dataresponseend JSONstringify message:"you are a winner!"@isolate 'DELETE'->#more logic
It's pretty simple to write and read with that shorthand. Here is what is actually happening in the code:
var delim = qcmapperisolateDelimiterqcmapperqcmapper//ect...
That is also very readable, but it takes a lot of characters.
command, and the
cf functions all return the same object that is
this in the callbacks, you can chain! Here is an example from the qc tests:
You just have to remember that
cf functions do not return the same object. This is not valid:
Remember, if you can chain something, you can store it.
iso = basiccomOne = isocomOnecomTwo = isocomTwo
No, but you can with mixins!
So this is awesome! You can use QC in the way that works for you. It's more than just flow control, it's designed to help you get things done faster, higher, and stronger.
Head on over to our example page!
QuickConnect started as a response to some of the problems encountered writing code for Enterprise Java servers. The framework pattern evolved for several years in a hybrid mobile environment (QCHybrid, iOS and Android) which provided tools for rapid prototyping of cross-platform apps.
QC is pretty mature and very functional, so it didn't make sense to publish a version <1.0.0
Here is how it works: When we change to version x.y.z
Because QC has a history older than Node.js, it has some things in it that are leftovers from other incarnations. 'handleRequest' is the oldest part; it comes from living on a server that handles client requests. It has been pointed out that a 'request', a 'command', and a 'stack' are all related, but come from different points in the history. We want to increase the 'y' part of the version by building better ways for people to use QC in their codeflow and workflow.
Fork the repo, submit a pull request and tell us your rational for the change; we would love to hear all ideas.
We feel the core logic of QC is pretty set in version 1.0.0, but if you have ideas for version 2.0.0, fork the repo or drop us a line!
Copyright (c) 2013 Joshua Barney, Lee Barney
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.