Detalhes do pacote

atma-io-middleware-base

tenbits2511.0.51

Atma IO middleware abstraction

readme (leia-me)

Atma IO Middleware Abstraction

Helper util to create atma-io middlewares

Extends:

  • atma-io with a custom middleware to read/compile/preprocess files

For usage examples refer to:

API

create
var { create } = require('atma-io-middleware-base');
create({
    name: 'my-super-middleware',
    process (content: string, filename: string, options: string) {
        return { content: string, sourceMap: string };
    }
    processAsync (content: string, filename: string, options: string) {
        return Promise.resolve({content: string, sourceMap: string});
    }
})

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

{

    "settings": {
        "%middleware-name%": {
            "foo": "baz"
        }
    }

}

2017 (c) MIT License - Atma.js Project