0.2.0 • Public • Published


    Front End framework build to be fast and simple.

    I wanted the best of RequireJS, Backbone and AngularJS in a simple framework. We can differ in what is the best of requireJS, AngularJS, and Backbone but let me explain what I think about that.

    Positive things about BasicJS:

    • HTML extensions
    • Plugins system to build your own HTML extensions
    • True Dependency Injection (not need to put a lot of scripts in yout HTML)
    • HTML is not polluted
    • Events are declared in the controllers, not everywhere (you can but I don't encourage you to do that) I want to debug my app easily
    • You can load ONLY what you use, and you use only what you want
    • Lightweight
    • BasicJS is super fast
    • You can build your html attributes, tags and whatever you want in an real easy way
    • Not strange pseudo language
    • The HTML can be converted to JSON and then to HTML easily, so designers can work with HTML and developers with JSON. So both can be happy.
    • VDOM
    • Mustache-like template system
    • CSS engine selector
    • Shim config and dependencies simple
    • BasicJS order which script load first for you

    One entry point

    This is how your HTML looks

    <!DOCTYPE html>
    <html lang="en">
        <meta charset="UTF-8">
        <title>Your basicJS app</title>
        <script type="text/javascript" data-main="/main.js" src="/basic.js"></script>

    Real dependency injection

    Built requireJS way, you don't need to include every script in your html, BasicJS do that for you when the app needed.

    • This is how your modules looks with basicJS *
    var someModule = $b.def([
    ], function(script, template) {
        // do something with the script and template


    Routing can be a real pain, is because of that I made this so simple, all the capabilities a developer want in a simple and concise way. With really simple regex filters.

    • This is how you can declare your routes in the app, with built-in filters *
    var AppLoader = $b.def([
    ], function(_default, _user) {
          '/user/id/some/thing': {
             controller: _user,
             params: {
                id: '\\d{1,3}',
                thing: '[a-z]{1,6}'
          'default': {
             controller: _default


    Simple and compact, $b.controller execute the initialize first, then the render if you have one and binds the events you want. Easy to debug, all your events in the controller. No more look everywhere for a listener.

    var UserCtrl = $b.def([
    ], function(userTmp, values, functionClick, params) {
        // params are the params you put in the url, already filtered
          el: $'body')[0],
          initialize: function() {
             this.vdom = $b.vdom.process($b.vdom.html2json(userTmp), values);
             this.html = $b.vdom.json2html(this.vdom);
             return this;
          render: function() {
             this.el.innerHTML = this.html;
          events: {
             'click #function': functionClick,
             'mouseover .user': function() {
                console.log('hover on .user');


    I already made a bc-repeat, but you can build your own attributes with the behaviour you want in an easy way.

    <div class="some">
        <h1 id="function">{{title}}</h1>
        <ul bc-repeat="k in value">
            <li class="user">
                <a>Your name is: {{}}</a>
                <span> Fullname: {{}} {{k.lastname}}</span>

    HTML extensions

    You can extend HTML, tags, attrs, everything can be added and I plan to have a lot of extensions you can download and use. bc-repeat is an example.

    This is how you extends HTML attributes

        bc_repeat: function(json, params) {
            // code

    Here I load bc-repeat extension, now I can use it in the app.

    ], function(App) {

    Easy shim config

    Is clear enough i guess.

       jquery: {
          url: '/jquery-1.11.3.min.js'
       underscore: {
          url: '/underscore-min.js',
          deps: ['jquery']

    To be continued...


    npm i basic-js

    DownloadsWeekly Downloads






    Last publish


    • lkzwieder