Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-glob

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-glob

Parse a glob pattern into an object of path parts.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3M
increased by83.13%
Maintainers
1
Weekly downloads
 
Created
Source

parse-glob NPM version

Parse a glob pattern into an object of path parts.

Install with npm

npm i parse-glob --save

Usage

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

// this is a nonsensical pattern, but it shows what this lib does
parse('a/b/{c,.gitignore,{a,b}}/{a,b}/*.foo.js');

Returns:

{ isGlob: true,
  pattern: 'a/b/{c,.gitignore,{a,b}}/{a,b}/*.foo.js',
  dirname: 'a/b/{c,.gitignore,{a,b}}/{a,b}/',
  filename: '*.foo.js',
  basename: '*',
  extname: '.foo.js',
  ext: 'js',

  // detects when a glob pattern intentionally 
  // specifies dotfiles or dot directories (e.g. './.git/')
  dotfiles: false,
  dotdirs: false }

See the tests for hundreds of examples.

Run tests

Install dev dependencies:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb on February 07, 2015.

FAQs

Package last updated on 07 Feb 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc