Socket
Book a DemoInstallSign in
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.5.0
latest
Source
npmnpm
Version published
Weekly downloads
177K
-5.74%
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

github

FAQs

Package last updated on 15 Aug 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.