Have ideas to improve npm?Join in the discussion! »

    glob-promise
    TypeScript icon, indicating that this package has built-in type declarations

    4.1.0 • Public • Published

    Promise version of glob

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

    license release super linter test semantic

    Note: This is just a Promise wrapped version of glob

    Install

    $ npm install glob-promise glob
    NOTE:

    glob is set as a peerDependency in package.json

    • npm <= 2 will automatically install peerDependencies if they are not explicitly depended upon higher in the dependency tree.
    • npm >= 3 will no longer 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

    Install

    npm i glob-promise

    DownloadsWeekly Downloads

    1,638,294

    Version

    4.1.0

    License

    MIT

    Unpacked Size

    6.14 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar