Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

glob-promise

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-promise

Promise version of glob

latest
Source
npmnpm
Version
6.0.7
Version published
Weekly downloads
1.5M
-26.43%
Maintainers
1
Weekly downloads
 
Created
Source

Promise version of glob

Match files using the patterns the shell uses, like stars and stuff.

license release semantic

Note: This is just a Promise wrapped version of glob

[!IMPORTANT]
Glob has native Promise support as of v9.0.0, please use it directly. I will not issue a deprecation notice on this package, because I can't deal with the volume of angry tickets that will follow.

Install

npm install glob-promise glob
NOTE

glob is set as a peerDependency in package.json

  • npm >= 7 will automatically install peerDependencies
  • npm <= 6 will not automatically install peerDependencies.

You will need to manually add glob as a dependency to your project for glob-promise to work.

API

glob(pattern [, options])

Alias for glob.promise

glob.promise(pattern [, options])

pattern: String (glob pattern) options: Object or String Return: Object (Promise)

When it finishes, it will be fulfilled with an Array of filenames as its first argument.

When it fails to read the files, it will be rejected with an error as its first argument.

glob('**/*')
  .then(function(contents) {
    contents; //=> ['lorem', 'ipsum', 'dolor']
  });

glob('{foo,bar.baz}.txt', { nobrace: true })
  .then(function(contents) {
    contents; //=> []
  });

glob.glob(pattern [, options], cb)

see glob

glob.sync(pattern [, options])

see glob.sync()

glob.hasMagic(pattern, [options])

see glob.hasMagic()

Class: glob.Glob

see Glob

options

The option object will be directly passed to glob.

Author: Ahmad Nassri • Twitter: @AhmadNassri

Keywords

glob

FAQs

Package last updated on 13 Jun 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