koar
Application framework built with decoupling and asynchrony in mind.
Last updated 6 years ago by allain .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install koar 
SYNC missed versions from official npm registry.

koar

Early Days, do not use in production!!!

Application framework built with decoupling and asynchrony in mind.

Based on core.js but with a strong emphasis on asynchrony.

I'm not sure how useful this library will be, but I thought I'd learn something through the process of writing it.

build status

Installation

This module is installed via npm:

$ npm install koar

Example Usage

var Koar = require('koar');

var app = new Koar();

app.register('testing', function(sandbox) {
  var testingHtml;
  return {
    // Supports asynchronous initialization through returning promises
    init: function() {
      return Http.get('http://www.testing.com').then(function(html) {
        testingHtml = html;
        return true;
      })
    },

    destroy: function() {
      // Assuming destruction requires some asynchronous operations
      return new Promise(function(resolve) {
        setTimeout(function() {
          resolve();
        }, 100);
      });
    }
  };
});

app.start().then(function(result) {
  console.log(result);
});

//-> { testing: true }

Current Tags

  • 0.2.0                                ...           latest (6 years ago)

1 Versions

  • 0.2.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |