You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

expand-target

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expand-target

Expand target definitions in a declarative configuration.

Source
npmnpm
Version
0.2.3
Version published
Weekly downloads
32
14.29%
Maintainers
1
Weekly downloads
 
Created
Source

expand-target NPM version

Expand target definitions in a declarative configuration.

Table of contents

(Table of contents generated by verb)

Install

Install with npm

$ npm i expand-target --save

Usage

var target = require('expand-target');

Write declarative "target" definitions similar in concept to those used by grunt and make.

Basic example

target({
  files: {
    'a/': ['*.js'],
    'b/': ['*.js'],
    'c/': ['*.js']
  }
});

results in

{
  files: [
    {
      src: ['examples.js', 'index.js'],
      dest: 'a/'
    },
    {
      src: ['examples.js', 'index.js'],
      dest: 'b/'
    },
    {
      src: ['examples.js', 'index.js'],
      dest: 'c/'
    }
  ]
}

the same example with expand: true defined on the options

target({
  options: { expand: true },
  files: {
    'a/': ['*.js'],
    'b/': ['*.js'],
    'c/': ['*.js']
  }
});

results in

{
  options: {
    expand: true
  },
  files: [
    {
      src: ['examples.js'],
      dest: 'a/examples.js'
    },
    {
      src: ['index.js'],
      dest: 'a/index.js'
    },
    {
      src: ['examples.js'],
      dest: 'b/examples.js'
    },
    {
      src: ['index.js'],
      dest: 'b/index.js'
    },
    {
      src: ['examples.js'],
      dest: 'c/examples.js'
    },
    {
      src: ['index.js'],
      dest: 'c/index.js'
    }
  ]
}

See more examples. Visit expand-files for the full range of options and documentation.

Options

Any option from expand-files may be used. Please see that project for the full range of options and documentation.

options properties

The below "special" properties are fine to use either on an options object or on the root of the object passed to expand-files.

Either way they will be normalized onto the options object to ensure that [globby][] and consuming libraries are passed the correct arguments.

special properties

  • base
  • cwd
  • destBase
  • expand
  • ext
  • extDot
  • extend
  • flatten
  • rename
  • process
  • srcBase

example

Both of the following will result in expand being on the options object.

files({src: '*.js', dest: 'dist/', options: {expand: true}});
files({src: '*.js', dest: 'dist/', expand: true});

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.

This file was generated by verb-cli on September 02, 2015.

Keywords

config

FAQs

Package last updated on 04 Sep 2015

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