atma-loader

    1.0.11 • Public • Published

    Atma Loader Abstraction

    Used for the atma plugin creation to develop File read middleware, like compilers and preprocessors.

    Extends:

    • IncludeJS with a custom loader
    • atma-io with a custom middleware to read/compile/preprocess files
    • atma-server and Atma Toolkit with a HTTPHandler to serve compiled sources (with sourceMap support)

    For usage examples refer to:

    API

    create
    module.exports.create = function(data, ICompiler):AtmaPlugin
     
    /*
     * - data Object {
     *      name: String > Plugin Loader Name
     *      options: {
     *          mimeType: String > mimeType of the resource
     *          extensions: [String] > file extensions to bind the middleware to
     *          ... > other configuration, which is then passed to compiler
     *      }
     *  }
     *
     * - ICompiler Object {
     *      compile: function(source String, filepath String, config Object): ICompilationResult
     *      ?compileAsync: function(source, filepath, config): Deferred<ICompilationResult>
     *  }
     *
     *  ICompilationResult: {
     *      content: String > Should contain compiled result
     *      ?sourceMap: String > optional, Source Maps
     *  }
     */

    options could be extended then via package.json. Example:

    {
        "atma": {
            "settings": {
                "%loader-name%": {
                    "foo": "baz"
                }
            }
        }
    }
     

    (c) MIT License - Atma.js Project

    Keywords

    none

    Install

    npm i atma-loader

    DownloadsWeekly Downloads

    38

    Version

    1.0.11

    License

    MIT

    Last publish

    Collaborators

    • avatar