All Projects → globocom → nautilus.js

globocom / nautilus.js

Licence: Apache-2.0 license
[separated fork] Async JavaScript loader & dependency manager in ~600B [gziped]

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to nautilus.js

Asyncrat C Sharp
Open-Source Remote Administration Tool For Windows C# (RAT)
Stars: ✭ 819 (+1288.14%)
Mutual labels:  asynchronous, loader
React Async Fetcher
React component for asynchronous loading/fetch online data
Stars: ✭ 50 (-15.25%)
Mutual labels:  asynchronous, loader
promise4j
Fluent promise framework for Java
Stars: ✭ 20 (-66.1%)
Mutual labels:  asynchronous, deferred
ngx-translate-module-loader
Highly configurable and flexible translations loader for @ngx-translate/core
Stars: ✭ 31 (-47.46%)
Mutual labels:  loader
nim-redisclient
sync/async redis clients for Nim
Stars: ✭ 20 (-66.1%)
Mutual labels:  asynchronous
StateBuilder
State machine code generator for C++ and Java.
Stars: ✭ 30 (-49.15%)
Mutual labels:  asynchronous
requirex
A different kind of module loader 📦🦖
Stars: ✭ 20 (-66.1%)
Mutual labels:  loader
elfo
Your next actor system
Stars: ✭ 38 (-35.59%)
Mutual labels:  asynchronous
async-sockets
Library for asynchronous work with sockets based on php streams
Stars: ✭ 45 (-23.73%)
Mutual labels:  asynchronous
spinners-angular
Lightweight SVG/CSS spinners for Angular
Stars: ✭ 21 (-64.41%)
Mutual labels:  loader
gdmod
A mod loader and modding API for GDevelop games.
Stars: ✭ 15 (-74.58%)
Mutual labels:  loader
styx
Programmable, asynchronous, event-based reverse proxy for JVM.
Stars: ✭ 250 (+323.73%)
Mutual labels:  asynchronous
blackhole
Blackhole is an MTA written on top of asyncio, utilising async and await statements that dumps all mail it receives to /dev/null.
Stars: ✭ 61 (+3.39%)
Mutual labels:  asynchronous
favloader
Vanilla JavaScript library for loading animation in favicon (favicon loader)
Stars: ✭ 20 (-66.1%)
Mutual labels:  loader
SierraChartZorroPlugin
A Zorro broker API plugin for Sierra Chart, written in Win32 C++.
Stars: ✭ 22 (-62.71%)
Mutual labels:  asynchronous
aiodynamo
Asynchronous, fast, pythonic DynamoDB Client
Stars: ✭ 51 (-13.56%)
Mutual labels:  asynchronous
react-native-modal-loader
Customizable animated modal progress hud for react apps.
Stars: ✭ 36 (-38.98%)
Mutual labels:  loader
tgcalls
Voice chats, private incoming and outgoing calls in Telegram for Developers
Stars: ✭ 408 (+591.53%)
Mutual labels:  asynchronous
java-red
Effective Concurrency Modules for Java
Stars: ✭ 25 (-57.63%)
Mutual labels:  asynchronous
ex loader
Load a single beam file, apps (a set of beams), or an erlang release (a set of apps) to a node.
Stars: ✭ 12 (-79.66%)
Mutual labels:  loader

Nautilus.js

Async JavaScript loader & dependency manager in ~1kb (600B gziped)

Coverage Status

Used by G1's globocom, Jusbrasil

Why?

Old School

blocks CSS, Images and JavaScript.

<script src="jquery.js"></script>
<script src="my-jquery-plugin.js"></script>
<script src="my-app-that-uses-plugin.js"></script>

Middle School

loads as non-blocking, however one has to use an API definition as AMD or commonjs. This affects all the other scripts (including plugins).

<!-- AMD LOADER EXAMPLE -->
<script>
require(['jquery'], function($) {
    console.log($); // function (a,b){return new n.fn.init(a,b)}

    require(['my-jquery-plugin'], function() {
      /*
        If jquery plugin has an anonymous define, throw an error: Mismatched anonymous define() module...
      */
    });
});
</script>

New School

loads as non-blocking too, however Nautilus.js doesn't care if it's an anonymous define, has unexported module or things like that.

<script>
	nautilus.config({
		paths: {
			'jquery': 'libs/jquery.js',
			'jquery.nanoscroller': 'libs/jquery-nanoscroller.js',
			'waterfall': 'http://cdnjs.cloudflare.com/ajax/libs/waterfall.js/1.0.2/waterfall.min.js'
		}
	});

	nautilus(['jquery', 'waterfall'], ['jquery.nanoscroller'], function() {
		console.log($); // function (a,b){return new n.fn.init(a,b)}
		console.log(typeof($.fn.nanoScroller)); // 'function'
	});
</script>

What's the biggest difference about the current top script loaders?

Nautilus can define namespaces to script paths/links and you can manage easily. Besides 7~20x more lighter.

Getting

First of all, get Nautilus.js using Download Option or via package manager.

To get using NPM just run this command:

npm install @globocom/nautilusjs

Usage

To define specified paths, you must use the config method:

nautilus.config({
    paths: {
        'jquery': 'libs/jquery.js',
        'waterfall': 'http://cdnjs.cloudflare.com/ajax/libs/waterfall.js/1.0.2/waterfall.min.js'
    }
});

To start scripts asynchronous load:

nautilus(['jquery', 'waterfall'], function() {
    console.log($); // function (a,b){return new n.fn.init(a,b)}
    console.log(typeof(waterfall)); // 'function'
});

Browser Support

Chrome logo Firefox logo Internet Explorer logo Opera logo Safari logo
35+ 38+ 9+ 29+ 8+

Credits

Maded by @raphamundi and awesome contributors

License: MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].