All Projects → standard → deglob

standard / deglob

Licence: ISC license
📂 Take a list of glob patterns and return an array of file locations, respecting `.gitignore` and allowing for ignore patterns via `package.json`.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to deglob

glob-fs
file globbing for node.js. speedy and powerful alternative to node-glob. This library is experimental and does not work on windows!
Stars: ✭ 54 (+42.11%)
Mutual labels:  patterns, glob, glob-pattern
Micromatch
Contributing Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
Stars: ✭ 1,979 (+5107.89%)
Mutual labels:  glob, glob-pattern
glob-tool
A tool to test globs against sets of test strings quickly and easily for the DigitalOcean Community.
Stars: ✭ 14 (-63.16%)
Mutual labels:  glob, glob-pattern
tartifacts
📦 Create artifacts for your assemblies
Stars: ✭ 20 (-47.37%)
Mutual labels:  patterns, glob
is-valid-glob
Return true if a value is a valid glob pattern string, or array of glob patterns.
Stars: ✭ 21 (-44.74%)
Mutual labels:  glob, glob-pattern
Tiny Glob
Super tiny and ~350% faster alternative to node-glob
Stars: ✭ 710 (+1768.42%)
Mutual labels:  patterns, glob
faster-than-walk
Faster recursive directory walk on Python 3
Stars: ✭ 36 (-5.26%)
Mutual labels:  glob, glob-pattern
matched
Glob matching with support for multiple patterns and negation. Use `~` in cwd to find files in user home, or `@` for global npm modules.
Stars: ✭ 25 (-34.21%)
Mutual labels:  glob, glob-pattern
Globby
User-friendly glob matching
Stars: ✭ 1,864 (+4805.26%)
Mutual labels:  patterns, glob
Fast Glob
🚀 It's a very fast and efficient glob library for Node.js
Stars: ✭ 1,150 (+2926.32%)
Mutual labels:  patterns, glob
dots
Implements the wildcard file matching in Go used by golint, go test etc.
Stars: ✭ 26 (-31.58%)
Mutual labels:  glob, glob-pattern
to-absolute-glob
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Stars: ✭ 16 (-57.89%)
Mutual labels:  glob, glob-pattern
awesome-programming-books
List of good programming books for beginners and professionals
Stars: ✭ 68 (+78.95%)
Mutual labels:  patterns
Java-Programs
Java Practiced Problems including concepts of OOPS, Interface, String , Collection.
Stars: ✭ 51 (+34.21%)
Mutual labels:  patterns
flutter getx template
🍻🍀 This is source base for getx flutter. Optimize by lambiengcode
Stars: ✭ 43 (+13.16%)
Mutual labels:  patterns
glob
Pure Nim library for matching file paths against Unix style glob patterns.
Stars: ✭ 58 (+52.63%)
Mutual labels:  glob
KubernetesPatterns
YAML and Golang implementations of common Kubernetes patterns.
Stars: ✭ 71 (+86.84%)
Mutual labels:  patterns
NiceDemo
iOS project, built on improved MVP architecture using Coordinator pattern for routing 😎
Stars: ✭ 54 (+42.11%)
Mutual labels:  patterns
ACCESS-NYC-PATTERNS
ACCESS NYC Pattern library and design system documentation for https://access.nyc.gov. Maintained by @NYCOpportunity
Stars: ✭ 14 (-63.16%)
Mutual labels:  patterns
redis-patterns-console
An interactive (and reactive) console to try and go into the deep of Redis and its patterns!
Stars: ✭ 22 (-42.11%)
Mutual labels:  patterns

deglob travis npm downloads javascript style guide

Take a list of glob patterns and return an array of file locations, respecting .gitignore and allowing for ignore patterns via package.json.

Giant swaths of this code were extracted from standard. It seems useful outside of that tool, so I've attempted to extract it! :)

Install

npm install --save deglob

Usage

var deglob = require('deglob')

deglob(['**/*.js'], function(err, files) {
  files.forEach(function(file) {
    console.log('found file ' + file)
  })
})

// pass in some options to customize!

var path = require('path')
var opts = {
  cwd: path.join(__dirname, 'someDir'),
  useGitIgnore: false,
  usePackageJson: false
}

deglob(['**/*.js'], opts, function(err, files) {
  files.forEach(function(file) {
    console.log('found file ' + file)
  })
})

Ignoring files in package.json

deglob will look for a package.json file by default and use any ignore patterns defined.

To define patterns in package.json add somthing like this:

"config": {
  "ignore": ['**/*.bad']
}

If you do not fancy the config key, provide a different one using the configKey option.

Options

Option Default Description
useGitIgnore true Turn on/off allowing ignore patterns via .gitignore
usePackageJson true Turn on/off allowing ignore patterns via package.json config.
configKey 'config' This is the parent key in package.json to look for the ignore attribute.
gitIgnoreFile '.gitignore' Name of the .gitignore file look for (probably best to leave it default)
ignore [] List of additional ignore patterns to use
cwd process.cwd() This is the working directory to start the deglobbing

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

ISC

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].