🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.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.1
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/'}]}

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 August 28, 2015.

Keywords

config

FAQs

Package last updated on 29 Aug 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