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

@types/glob

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/glob

TypeScript definitions for Glob 5.0.10

  • 5.0.28-alpha
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

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

FAQs

Package last updated on 08 Jul 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