UNPKG

nsure

Version:

nsure is a JS class that allows deep testing/sanitation, modification chains and model generation of objects.

34 lines (33 loc) 3.78 kB
{ "name": "escalator", "description": "a javascript flow-control || step-wise execution system with between-step delays and in-execution step-manipulation and errorHandling", "url": "http://github.com/itsatony/escalator", "keywords": [ "flow control", "steps", "javascript", "dynamic", "VisualWeb" ], "author": { "name": "Toni Wagner", "email": "i@itsatony.com" }, "contributors": [], "licenses": [ "MIT" ], "dependencies": {}, "main": "./lib/escalator", "version": "0.2.1", "directories": { "lib": "./lib" }, "engines": { "node": "> 0.6.00" }, "readme": "escalator\n=========\n\na flow-control class for javascript (nodeJS & browser)\n\n##\tDESCRIPTION \n \nin async environments - we do love them - there are times when you need to make sure foo is run after bar in all cases.\nfor our VisualWeb framework we thus developed a object/class called escalator that allows us to write sequential code.\n \n * this code is part of the VisualWeb Project by \n \t* LinkCloud ( http://www.mylinkcloud.com )\n \t* ViSERiON UG (haftungsbeschraenkt) ( http://www.viserion.com ) \n * K!Lab GmbH ( http://www.klab-berlin.com )\n * MIT license. \n \n \n * AUTHOR: \n \t\t Toni Wagner @itsatony\n \t\t\n## USPs\n\n * escalator offers DELAYS between steps. These are handy to make your app more response during cpu/load intensive code sequences. For example timeouts are a good idea to update upload/downloaf/progress bars\n * escalator offers setting of code-SCOPE PER STEP, thus enabling you to control the memory environment your steps are run in.\n * escalator offers a CONSTANT NAMESPACE, actually its own namespace, which is made available (passed as an additional call parameter) to every step. Thus, exchange of data between steps is super-easy and straightforward.\n * escalator objects can PERSIST with fully running and debugging info if you want that.\n * escalator offers a debug/logging mode that will record the time each step takes. very handy for performance optimization and error tracing\n * escalator wraps each step-call into a try-catch and allows you to define the errorhandler.\n * escalator steps can control the flow of efficiently, even stop the complete escalator with a message.\n\n## DEPENDENCIES\n * dependencies were removed ... this is totally independent now .\n * it should integrate into NodeJS on the server-side or any browser-side with javascript enabled.\n\n## TESTS\n *\tnone yet ;(\n \n## VERSIONS\n * v0.1.0\tinitial public release\t\t08.05.2012\t\t\t\n * removed dependencies \n * enabled using the same file for client- and nodeJS server-side implementation\n \n## URLs\n * blogpost: <http://coffeelog.itsatony.com/escalator>\n * github: <https://github.com/itsatony/escalator>\n \n## CODE EXAMPLES\n * 1 - three steps, different configs \n\n```javascript\n \tvar someVar = 'hello';\n \tvar firstStep = {\n\t\tid: 'myFirstStep',\n\t\tpriority: 10,\n\t\texecutor: function(next, thisEscalator) {\n\t\t\tsomeVar = 'hello too'\n\t\t\tnext();\n\t\t}\n\t};\n\tvar secondStep = {\n\t\tid: 'mySecondStep',\n\t\tpriority: 20,\n\t\tdelay: 10,\n\t\tparameters: [ someVar ],\n\t\tscope: this,\n\t\texecutor: function(somethingWePassedIn, next, thisEscalator) {\n\t\t\tconsole.log(somethingWePassedIn);\n\t\t\tthisEscalator.anotherVariable = 42;\n\t\t\tnext();\n\t\t}\n\t};\t\n\tvar lastStep = {\n\t\tpriority: 22,\n\t\texecutor: function(next, thisEscalator) {\n\t\t\tconsole.log(thisEscalator.anotherVariable);\n\t\t\tnext();\n\t\t}\n\t};\n\tvar myDemoEscalator = new escalator(\n\t\t'demoEscalator',\n\t\t[ firstStep, secondStep, lastStep ]\n\t).start();\n\t\n```\n", "readmeFilename": "README.md", "_id": "escalator@0.2.1", "_from": "escalator@latest" }