Neurotoxin Powered Marketing
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    broccoli-flattenpublic

    broccoli-flatten

    Flattens file tree, so all files will appear in one directory. Example. This structure:

    /srcDir
    └┬dir
     ├─file2.js
     └┬dir
      ├─file3.js
      └─file4.js
    
    

    turns into this:

    /destDir
    ├─file1.js
    ├─file2.js
    ├─file3.js
    └─file4.js
    

    Installation

    npm install --save-dev broccoli-flatten

    Usage

    var flatten = require('broccoli-flatten');
    tree = flatten(tree, options);

    Options

    The following options are supported:

    • destDir dir where to put all files

    Example

    var pickFiles = require('broccoli-static-compiler');
    var flatten = require('broccoli-flatten');
     
    // this will flatten files in 'js' folder into anonymous function
    var files =  pickFiles('js', {
            srcDir: '/',
            files: ['*/*.js'],
            destDir: '/dist'
          })
    var files_flat = flatten(files, { destDir: 'dist' });
     
    module.exports = files_flat;

    install

    npm i broccoli-flatten

    Downloadsweekly downloads

    345

    version

    0.1.1

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar