Socket
Book a DemoInstallSign in
Socket

bundl-copy

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bundl-copy

Copy matched src files into another directory

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

bundl-copy

Copy matched src files into another directory

Runs with the amazing Bundl build tool at the src stage

Install

$ npm install --save-dev bundl-copy

Use

var Bundl = require('bundl');
var copy = require('bundl-copy');

var options = {
    dest: 'dist/public',
    flatten: true
};

new Bundl(targets)
    .src(copy(options))
    .go();

Setting the destination path (required)

This can be done by simply passing a string into the copy plugin

copy('dist/public')

Or, if more options are needed, it can be set as a member of the options object

copy({ dest: 'dist/public' })

Options

basedir

By default, copied files maintain their original paths relative to basedir when copied into the dest folder. If basedir is not specified, process.cwd() will be used.

{
    basedir: 'src/stylesheets'
}

filter

If provided, this Function will be used to filter which files should be copied. Returning true allows the current file to be copied. Returning false skips the current file.

{
    filter: function (extName, fileName, srcPath) {
        if (extName === 'css' && fileName.indexOf('_private') === -1) {
            return true;
        }
    }
}

flatten

Setting flatten to true will cause all matched files to be copied into the root of dest (basedir will be ignored).

{
    flatten: true
}

FAQs

Package last updated on 16 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.