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

@actions/glob

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@actions/glob

Actions glob lib

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
139K
decreased by-11.02%
Maintainers
5
Weekly downloads
 
Created

What is @actions/glob?

@actions/glob is an npm package designed to help with file matching and globbing patterns in GitHub Actions workflows. It allows users to find files and directories using glob patterns, which can be useful for tasks such as file manipulation, testing, and deployment.

What are @actions/glob's main functionalities?

Basic File Matching

This feature allows you to match files based on a glob pattern. In this example, it matches all JavaScript files in the directory and its subdirectories.

const glob = require('@actions/glob');

async function run() {
  const pattern = '**/*.js';
  const globber = await glob.create(pattern);
  for await (const file of globber.globGenerator()) {
    console.log(file);
  }
}

run();

Excluding Files

This feature allows you to exclude certain files or directories from the matching process. In this example, it matches all JavaScript files except those in the node_modules directory.

const glob = require('@actions/glob');

async function run() {
  const pattern = '**/*.js';
  const excludePattern = '**/node_modules/**';
  const globber = await glob.create(pattern, { ignore: [excludePattern] });
  for await (const file of globber.globGenerator()) {
    console.log(file);
  }
}

run();

Matching Directories

This feature allows you to match directories based on a glob pattern. In this example, it matches all directories in the current directory and its subdirectories.

const glob = require('@actions/glob');

async function run() {
  const pattern = '**/';
  const globber = await glob.create(pattern);
  for await (const dir of globber.globGenerator()) {
    console.log(dir);
  }
}

run();

Other packages similar to @actions/glob

Keywords

FAQs

Package last updated on 13 Nov 2020

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