Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neurospeech/callback-heaven.js
Macros for JavaScript to write shorter syntax and expand inline expressions
https://github.com/neurospeech/callback-heaven.js
Last synced: about 2 months ago
JSON representation
Macros for JavaScript to write shorter syntax and expand inline expressions
- Host: GitHub
- URL: https://github.com/neurospeech/callback-heaven.js
- Owner: neurospeech
- License: apache-2.0
- Created: 2015-04-04T04:12:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-19T09:38:58.000Z (almost 5 years ago)
- Last Synced: 2024-10-05T15:04:32.821Z (3 months ago)
- Language: JavaScript
- Size: 216 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Callback Heaven
Callbacks are very difficult to write and program. So I decided to create asyncVM,
an asynchronous vm that accepts objects and arrays as instructions which may or
may not be async in nature.## Callback Converter
Callback converts $wait() functions to Async AVM instructions, which are
executed in async timeline explained below. This conversion happens automatically
however you can still use avm independently of this converter and create your own
set of instructions.## AVM
To run generated code, you will need avm.## How to compile?
var heaven = require('callback-heaven');
var fs = require('fs');
var script = fs.readFileSync('input.js','utf8');
script = heaven.compile(script);
fs.writeFileSync('ouput.js',script, 'utf8');
## How to runGenerated output script will refer "avm" , which is available from
https://github.com/neurospeech/avm.js ornpm install avmjs
## Supported statementsfunction testVM(){
var countries = $wait($.get('/countries'));
for(var i=0; i