Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flatten-dirname

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

flatten-dirname

Flatten files to from relative folders. But keep dirname on filename.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

flatten-dirname

NPM version Build status

Flatten files to from relative folders. But keep dirname on filename.

Installation

npm install flatten-dirname --save

Usage

fdname(glob,dest,options,callback)

Example

var fdname = require('flatten-dirname');


fdname('**/*.png','./destFolder',function(){

});


// this
// heroes/lulu/hit/001.png
// heroes/lulu/hit/002.png
// heroes/janna/walk/001.png

// return
// destFolder/heroes_$_lulu_$_hit_$_001.png
// destFolder/heroes_$_lulu_$_hit_$_002.png
// destFolder/heroes_$_janna_$_walk_$_001.png


// or
fdname(['**/*.png'],'./destFolder',{split:'@'},function(){

});

// with all options
fdname(['**/*.png'],'./destFolder',{split:'@'},function(err,data){

});

Options

OptionDescriptionDefault
splitSplit string._$_

CLI

npm install flatten-dirname -g
Usage
	$ fdname <glob> <dest>

Options
	--split Split string. Default: "_$_"

Examples
	fdname "**/*.png"
	fdname "**/*.png" destFolder/
	fdname "**/*.png" "destFolder/" --split "@"

Check Also

filename-to-dir

License

MIT

Keywords

FAQs

Package last updated on 22 Feb 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc