globalyzer
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/globalyzer package

0.1.4 • Public • Published

globalyzer Build StatusBuild status

Detect and extract the static part of a glob string

Utility to detect if a string contains a glob and then split it in a glob and none-glob part.

Install

npm install globalyzer --save

Usage

const globalyzer = require('globalyzer');
 
globalyzer('foo/bar/.git/');
// => { base: 'foo/bar/.git/', glob: '', isGlob: false }
 
globalyzer('foo/bar/**/baz');
// => { base: 'foo/bar', glob: '**/baz', isGlob: true }

API

globalyzer(glob, options)

Type: function
Returns: { base, glob, isGlob }

Returns an object with the (non-glob) base path and the actual pattern and a is-glob flag.

options.strict

Type: Boolean
Default: true

Be strict about what's a glob and what's not

glob

Type: String

Glob string to analyze.

Credit

This is a fork of is-glob and glob-base

License

MIT © Terkel Gjervig

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.4
    32,696
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.4
    32,696
  • 0.1.0
    1,705,021

Package Sidebar

Install

npm i globalyzer

Weekly Downloads

1,737,717

Version

0.1.4

License

MIT

Unpacked Size

11.6 kB

Total Files

5

Last publish

Collaborators

  • terkelg