Socket
Socket
Sign inDemoInstall

@types/glob

Package Overview
Dependencies
3
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

@types/glob

TypeScript definitions for glob

    8.1.0ts4.2ts4.3ts4.4ts4.5ts4.6ts4.7ts4.8ts4.9ts5.0ts5.1latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
13,031,661
decreased by-15.05%

Weekly downloads

Package description

What is @types/glob?

The @types/glob package provides TypeScript type definitions for the glob library, which is a utility that allows for pattern matching based on the rules used by the Unix shell. These type definitions enable TypeScript developers to use glob in a type-safe manner, ensuring that their usage of glob adheres to the expected types and interfaces.

What are @types/glob's main functionalities?

Pattern Matching

This feature allows you to match files in your filesystem using glob patterns. The example demonstrates how to find all TypeScript (.ts) files in a project and log them.

import * as glob from 'glob';

glob('**/*.ts', (err, files) => {
  if (err) {
    console.error('Glob pattern error', err);
    return;
  }
  console.log('Matched files:', files);
});

Synchronous Pattern Matching

This feature provides a way to synchronously find files matching a pattern. The code sample shows how to synchronously find and log all JavaScript (.js) files.

import * as glob from 'glob';

const files = glob.sync('**/*.js');
console.log('Matched JavaScript files:', files);

Using Options

This feature demonstrates how to use options to refine the search. In the example, the search is for all TypeScript files, excluding those in the node_modules directory.

import * as glob from 'glob';

glob('**/*.ts', { ignore: '**/node_modules/**' }, (err, files) => {
  if (err) {
    console.error('Glob pattern error', err);
    return;
  }
  console.log('Matched files:', files);
});

Other packages similar to @types/glob

Readme

Source

Installation

npm install --save @types/glob

Summary

This package contains type definitions for glob (https://github.com/isaacs/node-glob).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/glob.

Additional Details

  • Last updated: Wed, 22 Feb 2023 22:32:38 GMT
  • Dependencies: @types/minimatch, @types/node
  • Global values: none

Credits

These definitions were written by vvakame, voy, Klaus Meinhardt, and Piotr Błażejewicz.

FAQs

Last updated on 22 Feb 2023

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc