🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

files-objects

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

files-objects

Expand files objects into src-dest mappings.

Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

files-objects NPM version

Expand files objects into src-dest mappings.

Install

Install with npm

$ npm i files-objects --save

Usage

var toMapping = require('files-objects');
toMapping(src, dest, options);
// or
toMapping({src: src, dest: dest});

Examples

All of the following result in the same object:

toMapping('lib/*.js', 'foo/');
toMapping({'foo/': 'lib/*.js'});
toMapping({dest: 'foo/', src: 'lib/*.js'});
//=> { files: [{ src: [ 'lib/*.js' ], dest: 'foo/' }]}

no dest

All of the following result in the same object:

toMapping('lib/*.js');
toMapping(['lib/*.js']);
toMapping({'': 'lib/*.js'});
toMapping({'': ['lib/*.js']});
toMapping({src: 'lib/*.js'});
toMapping({src: ['lib/*.js']});
toMapping({src: 'lib/*.js', dest: ''});
toMapping({src: ['lib/*.js'], dest: ''});
//=> {files: [{ src: ['lib/*.js'], dest: ''}]}

with dest

All of the following result in the same object:

toMapping('lib/*.js', 'foo/');
toMapping(['lib/*.js'], 'foo/');
toMapping({'foo/': 'lib/*.js'});
toMapping({'foo/': ['lib/*.js']});
toMapping({src: ['lib/*.js'], dest: 'foo/'});
toMapping({src: 'lib/*.js', dest: 'foo/'});
//=> {files: [{ src: ['lib/*.js'], dest: 'foo/'}]}
  • expand-config: Expand tasks, targets and files in a declarative configuration. | homepage
  • expand-files: Expand glob patterns in a declarative configuration into src-dest mappings. | homepage
  • expand-target: Expand target definitions in a declarative configuration. | homepage
  • expand-task: Expand and normalize task definitions in a declarative configuration. | homepage

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 02 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