ApplicationPrototype

Why Choose application-prototype?

Quick Example

// @run
// Create an event-driven object in 10 lines
var app = new ApplicationPrototype();

app.bind('greet', function (name) {
    return 'Hello, ' + name + '!';
});

app.on('beforeGreet', function (name) {
    console.log('About to greet:', name);
});

app.on('afterGreet', function (name) {
    console.log('Greeted:', name);
});

app.greet('World'); // logs: "About to greet: World" then "Greeted: World"

Module Overview

Module Group What It Does Key Advantage
Core Event-driven objects with lifecycle hooks Every method is automatically observable
Async Sequential & parallel async orchestration Control concurrency without Promise chains
UI / Templating Two-way data binding, components, custom elements Angular-like power without a build step
Networking HTTP client with progress, interception, routing Chainable API with upload/download events
Storage IndexedDB/localStorage key-value store ~200MB Promise-based storage
Resource Loading Dynamic script/stylesheet loading Lazy-load resources on demand
Graphics Image filters, canvas animation, conversions Pure JS image processing pipeline
Media Webcam capture, getUserMedia Simple callback API for camera access
Parsers CSV parse/encode, Markdown to HTML Lightweight data format conversion
Extensions 50+ utility methods, encryption, polyfills One import enriches all built-in prototypes
Extensions / Hashing bcrypt, Argon2, BLAKE2b, PHP password_*() API Zero-dependency, PHP-interoperable password hashes

Getting Started

<!-- Browser: just two script tags -->
<script src="ApplicationPrototype.js"></script>
<script src="ApplicationBuilder.js"></script>
<script>
    var App = new ApplicationBuilder({
        onready: function () {
            var App = this;
            App.modulePath('./constructors');
            App.require(['extensions/prototype', 'lib'], function (libs) {
                libs.lib();
                console.log('Application ready!');
            });
        }
    });
</script>
# Node.js: install and require
npm install application-prototype
var ApplicationPrototype = require('application-prototype').application;
var app = new ApplicationPrototype();
app.bind('hello', function () { return 'world'; });

Full Getting Started Guide | Architecture Overview

License

Creative Commons Attribution-NonCommercial 4.0 / or Granted by SGApps Labs
By Sergiu Gordienco | sgapps.io

sgapps.io