shortstop-concat

1.0.2 • Public • Published

shortstop-concat

Shortstop handler for concatenating multiple arrays (contained within specified files) into a single array.

'use strict';

const shortstop = require('shortstop');
const concatHandler = require('shortstop-concat');

let resolver = shortstop.create();
resolver.use({
    'concat': concatHandler()
));

// The handler expects to receive a glob pattern
let resolved = resolver.resolve({
    'routes': 'concat:./routes/**/*.json'
));

console.log(resolved);
/*
{
    'routes': [
        // ...
    ]
}
*/

};

Passing Base Directory and Additional Resolvers to the Concat Resolver

let handlers = require('extra-handlers');

resolver.use({
    'concat': concatHandler('../my-custom-dir', {
        'require': handlers.require(configDir),
        'path': handlers.path(configDir)
    })
});

Related Resources

Dependencies (5)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i shortstop-concat

    Weekly Downloads

    11

    Version

    1.0.2

    License

    ISC

    Last publish

    Collaborators

    • timambler