New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

argv-auto-glob

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argv-auto-glob

automatically expand globs (cross-platform) for the `process.argv` array (or similar)

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

argv-auto-glob.js npm AppVeyor Status Travis CI Status

automatically expand globs (cross-platform) for the process.argv array (or similar)

What is this?

Popular shells on macOS and Linux automatically expand globs prior to executing commands. However, the default shells on Windows do not.

This library checks a process.argv-like array of strings, detects any globs, and expands the globs. This is very convenient for developing consistent cross-platform CLI tools.

Usage

argvAutoGlob (argv, globOptions)

Example

We execute a Node.js script like so:

  • node path/to/index.js **/*.txt

where our index.js file contains:

#! /usr/bin/env node
const argvAutoGlob = require('argv-auto-glob')

process.argv
// => (Windows) ['.../node', '.../index.js', '**/*.txt']
// => (bash/zsh) ['.../node', '.../index.js', 'example.txt', 'dir/more.txt', ... ]

process.argv = argvAutoGlob(process.argv)

process.argv
// => (all) ['.../node', '.../index.js', 'example.txt', 'dir/more.txt', ... ]

Keywords

FAQs

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