<commit_before># Snooze 1.0.0-alpha.1
## Differences to pre-alpha snooze
Pretty much everything has been reworked here. Snooze is no longer opinionated on how it should be used and does not focus on creating a RESTful server (though it can still be used to). It has removed most of what was in the pre-alpha version to create a better foundation for a more powerful and modular framework. Mostly this is done in the way of Entities. **More information provided in the README below**.
## Installation
    # install snooze to your local project
    npm install snooze
    
    # install snooze-baselib as a starting place for your project
    npm install snooze-baselib
    
    # optionally install snooze-cli to start
    # your projects using a snooze.json config file
    sudo npm install -g snooze-cli
## Setup
To create a simple one-file snooze application an example is shown below. More advanced setups later in the README. It is recommended that beginners, intermediates, and advanced users use the `snooze-baselib` module unless there are specific reasons not to. The `snooze-baselib` module contains usefule `Entities` and `importProcesses`.

    // main.js
    (function() {
        'use strict';
        
        // Snooze is a global object. Because of node's require caching
        // the snooze object has one instance accross all files.
        var snooze = require('snooze');
        
        // Creates a myApp module and imports the `snooze-baselib` module
        snooze.module('myApp', ['snooze-baselib'])
            // Creates a run function that will be ran when the application starts
            .run(function() {
                console.log('Hello World!');
            })
            // Does some compiling and begins the app by calling all config
            // and run processes.
            .wakeup();
    })();
Outputs

    # running via terminal
    node main.js
    Hello World!
    
#### Modules
Modules are a flexible wrapper or foundation for your project. They can be designed to share a set of functionality to other modules (and are not intended to run alone), or they can be designed to run your application. Modules greatest strength is that it allows sharing functionality easily and in an abstrated, modular way. To create a module use the `snooze.module` method.

    var snooze = require('snooze');
    snooze.module('myApp', []);
    
When creating a module the second param is required. It can be an empty array or an array of modules to import. All module methods that don't return a value returns itself making commands chainable.

    snooze.module('myApp', []).doSomething().doSomethingElse();
    
If the modules is already created you can access it be omitting the array.

    snooze.module('myApp').doSomething();
    
#### Importing Modules
Importing modules lets you import functionality into your application seemlessly. Modules can be written yourself or downloaded using npm. `snooze-baselib` is a highly recommended starting point. Using it as an example, to install it and import it into your project do the following.

```
 npm install snooze-baselib --save
```
```
snooze.module('myApp', ['snooze-baselib']);
```

If the npm module hasn't been required using `require()` snooze will try to do this automatically. If you are trying to import a local module (not from npm) `require()` it manually before you try to import it into another module.

**Note** When a module is constructed the dependant modules will import immediately.

#### run
A run processes may be what you use to run your app. Your module can define multiple run processes that will get called once `wakeup` or `doRuns` is called. It's recommended you should use `wakeup` instead. Run processes allow injected Entities.

    angular.module('myApp').run(function(MyService) {
        MyService.doSomething();
    });
    
#### config
Config processes are called before run processes. Entities may define a config object. This is up to the writer of the entity to provide as well as document.

    angular.module('myApp').config(function(MyService) {
        MyService.maxSomethings = 10;
    }).run(function(MyService) {
        MyService.doSomething();
    });
    
Depending on how the Entity is written. Some entities may provide a config and an injectable, just a config, or just an injectable. See the documentation of the Entity for it's possible uses.

#### wakeup
Because I am a pun-master (i'm not), to start your *snooze* application you should *wakeup*. This will go through the `configPreprocessors`, `config` processes, and `run` processes in that order.

    snooze.module('myApp')
        .run(function() {
            console.log('foo');<commit_msg>fixed angular typo<commit_after># Snooze 1.0.0-alpha.1
## Differences to pre-alpha snooze
Pretty much everything has been reworked here. Snooze is no longer opinionated on how it should be used and does not focus on creating a RESTful server (though it can still be used to). It has removed most of what was in the pre-alpha version to create a better foundation for a more powerful and modular framework. Mostly this is done in the way of Entities. **More information provided in the README below**.
## Installation
    # install snooze to your local project
    npm install snooze
    
    # install snooze-baselib as a starting place for your project
    npm install snooze-baselib
    
    # optionally install snooze-cli to start
    # your projects using a snooze.json config file
    sudo npm install -g snooze-cli
## Setup
To create a simple one-file snooze application an example is shown below. More advanced setups later in the README. It is recommended that beginners, intermediates, and advanced users use the `snooze-baselib` module unless there are specific reasons not to. The `snooze-baselib` module contains usefule `Entities` and `importProcesses`.

    // main.js
    (function() {
        'use strict';
        
        // Snooze is a global object. Because of node's require caching
        // the snooze object has one instance accross all files.
        var snooze = require('snooze');
        
        // Creates a myApp module and imports the `snooze-baselib` module
        snooze.module('myApp', ['snooze-baselib'])
            // Creates a run function that will be ran when the application starts
            .run(function() {
                console.log('Hello World!');
            })
            // Does some compiling and begins the app by calling all config
            // and run processes.
            .wakeup();
    })();
Outputs

    # running via terminal
    node main.js
    Hello World!
    
#### Modules
Modules are a flexible wrapper or foundation for your project. They can be designed to share a set of functionality to other modules (and are not intended to run alone), or they can be designed to run your application. Modules greatest strength is that it allows sharing functionality easily and in an abstrated, modular way. To create a module use the `snooze.module` method.

    var snooze = require('snooze');
    snooze.module('myApp', []);
    
When creating a module the second param is required. It can be an empty array or an array of modules to import. All module methods that don't return a value returns itself making commands chainable.

    snooze.module('myApp', []).doSomething().doSomethingElse();
    
If the modules is already created you can access it be omitting the array.

    snooze.module('myApp').doSomething();
    
#### Importing Modules
Importing modules lets you import functionality into your application seemlessly. Modules can be written yourself or downloaded using npm. `snooze-baselib` is a highly recommended starting point. Using it as an example, to install it and import it into your project do the following.

```
 npm install snooze-baselib --save
```
```
snooze.module('myApp', ['snooze-baselib']);
```

If the npm module hasn't been required using `require()` snooze will try to do this automatically. If you are trying to import a local module (not from npm) `require()` it manually before you try to import it into another module.

**Note** When a module is constructed the dependant modules will import immediately.

#### run
A run processes may be what you use to run your app. Your module can define multiple run processes that will get called once `wakeup` or `doRuns` is called. It's recommended you should use `wakeup` instead. Run processes allow injected Entities.

    snooze.module('myApp').run(function(MyService) {
        MyService.doSomething();
    });
    
#### config
Config processes are called before run processes. Entities may define a config object. This is up to the writer of the entity to provide as well as document.

    snooze.module('myApp').config(function(MyService) {
        MyService.maxSomethings = 10;
    }).run(function(MyService) {
        MyService.doSomething();
    });
    
Depending on how the Entity is written. Some entities may provide a config and an injectable, just a config, or just an injectable. See the documentation of the Entity for it's possible uses.

#### wakeup
Because I am a pun-master (i'm not), to start your *snooze* application you should *wakeup*. This will go through the `configPreprocessors`, `config` processes, and `run` processes in that order.

    snooze.module('myApp')
        .run(function() {
            console.log('foo');
{'fraction_non_alphanumeric': 0.07517836226173996, 'fraction_numerical': 0.0012778191885848152, 'mean_word_length': 3.2983981693363846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7089482', 'n_tokens_mistral': 2558, 'n_tokens_neox': 2475, 'n_words': 1219}