atma-io-middleware-base
TypeScript icon, indicating that this package has built-in type declarations

1.0.46 • Public • Published

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_

/atma-io-middleware-base/

    Package Sidebar

    Install

    npm i atma-io-middleware-base

    Weekly Downloads

    1,450

    Version

    1.0.46

    License

    none

    Unpacked Size

    67.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • tenbits