glob-utils

Utilities for file globbing and Grunt.js projects.

Usage no npm install needed!

<script type="module">
  import globUtils from 'https://cdn.skypack.dev/glob-utils';
</script>

README

glob-utils NPM version

Utilities for file globbing and Grunt.js projects.

Install

Install with npm:

npm i glob-utils --save-dev

Usage

var glob = require('glob-utils');

API

.expand

  • 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

  • patterns {String}: File paths or glob patterns to expand.
  • options {Object}: Options to pass to [globby]
  • returns: {Array}

Return a glob of basenames.

.parse

  • 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

  • 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

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

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on August 28, 2014.