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

tree-exec

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-exec

Walks a tree and executes a command for each path.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Tree exec

Node.js cli utility that walks a path and executes a command for each file on the path.

Motivation

Trying to use NPM as a build tool can be complicated in windows, the biggest problem beeing the shell don't expand glob patterns, so some utilities need a for loop to work properly, to aid with interop this package was developed.

Basic usage

$ tree-exec [options] <command>

Examples:

$ tree-exec -a command @f
$ tree-exec -g="./**/*.ext" command @f
$ tree-exec -r="[^node_modules]\/.*$" command @f

Options:

Parameter:Description:
-h, --helpShow this information.
-p, --pathThe base path to start the search, if it is different from the current working directory.
-d, --depthSets the depth to search.
-g, --globA glob pattern to use as search.
-r, --regexA RegExp pattern to use as search.
-a, --allSearch throug all files.
-i, --icaseSet case insensitiveness of the search.
-x, --dotSets if it should include paths starting with ..
-l, --librarySets if it should include library paths like node_modules or bower_components.
-u, --unicodeSet the unicode flag. NOTE: Only use if your node version supports it, or it will give wrong results.
-s, --globstarDisable ** matching against multiple folder names.
-c, --nocomentSuppress the behavior of treating # at the start of a pattern as a comment.
-n, --nonegateSuppress the behavior of treating a leading ! character as negation.
-e, --noextDisable "extglob" style patterns like +(a¦b).
-b, --nobraceDo not expand {a,b} and {1..3} brace sets.
-m, --mathbaseIf set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, a?b would match the path /xyz/123/acb, but not /xyz/acb/123.

Replace options

The following options can be used after @:

OptionResultExample
fThe path, name and extension of the file../dir/file.ext
nThe name of the file.file
eThe extension of the file (with dot)..ext
rThe relative path of the file../dir/
pThe full path of the file./home/user/dir/
sThe file size (in human redable format).1KB
zThe file size (in bytes).1024
mThe file's last modified timestamp.2016116043022876
tThe file's creation timestamp.2016116043022876

If the options are preceeded by a ~ then the path will be unquoted. Eg.: @~f will produce ./dir/file.ext

TODO

  • Test against git bash and other *nix shells for completeness.
  • Add attributes flag to file.

Keywords

FAQs

Package last updated on 19 Feb 2016

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