<commit_before># East End

A small, simple Promise-first Javascript module loader for modern browsers.
It's inspired by the AMD loader spec but it uses Promises rather than callbacks.
It can also load non-AMD Javascript libraries.

There's an implementation of the API for running in pages (`eastend.js`) and one for use in Workers (`eastend-worker.js`).

It's named after the east end of Alameda, where I live. Because there's another module loader with Promises called [Alameda](https://github.com/requirejs/alameda).

## License
&copy; 2016 [<NAME>](https://ian.mckellar.org/) <<EMAIL>>

Distributed under the [MIT](COPYING) license.

## Usage
### Module naming
Modules are refered to by URL. This is a departure from the AMD approach, but it seems easier to reason about. Modules URLs are relative to where they're being referenced, so in a page they're relative to that page's location but in module dependencies they're relative to the module's URL. 

### Module API
Modules are Javascript files. Each file can only contain one module. Modules declare a list of dependencies and a function that returns the module's value. That value can be a promise.

#### Define a module:

    define([], function() {
        return {"hello": "world"};
    });
    
#### Define a module with dependencies:
<commit_msg>brag about size<commit_after># East End

A small, simple Promise-first Javascript module loader for modern browsers.
It's inspired by the AMD loader spec but it uses Promises rather than callbacks.
It can also load non-AMD Javascript libraries.

It's really quite small - under 1k before compression.

There's an implementation of the API for running in pages (`eastend.js`) and one for use in Workers (`eastend-worker.js`).

It's named after the east end of Alameda, where I live. Because there's another module loader with Promises called [Alameda](https://github.com/requirejs/alameda).

## License
&copy; 2016 [<NAME>](https://ian.mckellar.org/) <<EMAIL>>

Distributed under the [MIT](COPYING) license.

## Usage
### Module naming
Modules are refered to by URL. This is a departure from the AMD approach, but it seems easier to reason about. Modules URLs are relative to where they're being referenced, so in a page they're relative to that page's location but in module dependencies they're relative to the module's URL. 

### Module API
Modules are Javascript files. Each file can only contain one module. Modules declare a list of dependencies and a function that returns the module's value. That value can be a promise.

#### Define a module:

    define([], function() {
        return {"hello": "world"};
    });
    
#### Define a module with dependencies:

{'fraction_non_alphanumeric': 0.0870052277819268, 'fraction_numerical': 0.0033607169529499626, 'mean_word_length': 4.222222222222222, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6282299', 'n_tokens_mistral': 750, 'n_tokens_neox': 681, 'n_words': 372}