UNPKG

glob-utils

Version:

Utilities for file globbing and Grunt.js projects.

76 lines (48 loc) 1.86 kB
# glob-utils [![NPM version](https://badge.fury.io/js/glob-utils.svg)](http://badge.fury.io/js/glob-utils) > Utilities for file globbing and Grunt.js projects. ## Install #### Install with [npm](npmjs.org): ```bash npm i glob-utils --save-dev ``` ## Usage ```js var glob = require('glob-utils'); ``` ## API ### [.expand](index.js#L27) * `patterns` **{String}**: File paths or glob patterns to expand. * `options` **{Object}**: Options to pass to [globby] * `returns`: {Array} Return a glob of file paths. ### [.basename](index.js#L41) * `patterns` **{String}**: File paths or glob patterns to expand. * `options` **{Object}**: Options to pass to [globby] * `returns`: {Array} Return a glob of basenames. ### [.parse](index.js#L57) * `patterns` **{String}**: File paths or glob patterns to expand. * `options` **{Object}**: Options to pass to [globby] and [gray-matter] * `returns`: {Array} Return a glob of files, with yaml front matter parsed. ### [.read](index.js#L75) * `patterns` **{String}**: File paths or glob patterns to expand. * `options` **{Object}**: Options to pass to [globby] * `returns`: {Array} Return a glob of files with content. ### [.file](index.js#L96) Return a glob of file objects, including: * `patterns` **{String}**: File paths or glob patterns to expand. * `options` **{Object}**: Options to pass to [globby] * `returns`: {Array} - `basename`: the basename of the file path - `content`: the content, from `fs.readFileSync` ## Author **Jon Schlinkert** + [github/assemble](https://github.com/assemble) + [twitter/assemble](http://twitter.com/assemble) ## License Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license *** _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 28, 2014._