{"id":18392,"library":"glob-fs-dotfiles","title":"glob-fs-dotfiles","description":"A middleware package for glob-fs that automatically ignores dotfiles (files and directories starting with a dot) during file globbing. Version 0.1.6 is the latest and only release. It was originally a built-in middleware for glob-fs but can be used directly when the default middleware stack is disabled. Key differentiators: provides fine-grained control over dotfile handling via options like 'dot', 'dotdirs', 'dotfiles'. The package is part of the glob-fs ecosystem but is deprecated in favor of glob-fs's built-in support.","status":"deprecated","version":"0.1.6","language":"javascript","source_language":"en","source_url":"https://github.com/jonschlinkert/glob-fs-dotfiles","tags":["javascript","fs","dot","dotfiles","dotfile","gitignore","glob","glob-fs","ignore"],"install":[{"cmd":"npm install glob-fs-dotfiles","lang":"bash","label":"npm"},{"cmd":"yarn add glob-fs-dotfiles","lang":"bash","label":"yarn"},{"cmd":"pnpm add glob-fs-dotfiles","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as the file globbing engine and middleware consumer","package":"glob-fs","optional":false}],"imports":[{"note":"ESM import works if using bundler/Node supporting ESM, but package is CommonJS-only. Use require for Node < 14.","wrong":"const dotfiles = require('glob-fs-dotfiles');","symbol":"dotfiles","correct":"import dotfiles from 'glob-fs-dotfiles';"},{"note":"No named export; only default export available.","wrong":"import { dotfiles } from 'glob-fs-dotfiles';","symbol":"default","correct":"const dotfiles = require('glob-fs-dotfiles');"},{"note":"dotfiles() returns a middleware function; calling it is required.","wrong":"var glob = require('glob-fs')({}).use(require('glob-fs-dotfiles'));","symbol":"dotfiles function","correct":"var glob = require('glob-fs')({}).use(require('glob-fs-dotfiles')());"}],"quickstart":{"code":"var dotfiles = require('glob-fs-dotfiles');\nvar glob = require('glob-fs')({ builtins: false }) // disable built-ins\n  .use(dotfiles()) // apply dotfiles middleware\n  .readdir('*', function(err, files) {\n    if (err) console.error(err);\n    else console.log(files);\n  });","lang":"javascript","description":"Shows require and use of glob-fs-dotfiles middleware with glob-fs, including disabling built-ins for explicit control."},"warnings":[{"fix":"Use glob-fs without this package; dotfiles are ignored by default. Or if you need to include them, use options.dot: true in glob-fs.","message":"Package is deprecated; functionality is built into glob-fs as default middleware.","severity":"deprecated","affected_versions":"*"},{"fix":"Ensure glob-fs is installed and you create a glob-fs instance before using this middleware.","message":"Must be used with glob-fs; standalone usage not possible.","severity":"gotcha","affected_versions":"*"},{"fix":"Use .use(dotfiles()) instead of .use(dotfiles).","message":"Requires calling dotfiles() as a function to get the middleware, not the exported value itself.","severity":"gotcha","affected_versions":"*"},{"fix":"Use dotfiles({dot: true}) to include dotfiles; otherwise they are ignored.","message":"If you want to include dotfiles, you must pass options to the middleware: dotfiles({dot: true}).","severity":"breaking","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install glob-fs: npm install glob-fs --save and require it before using .use().","cause":"glob-fs not imported correctly or not installed; glob.use is undefined.","error":"TypeError: glob.use is not a function"},{"fix":"Create a glob-fs instance first: var glob = require('glob-fs')(options); glob.use(require('glob-fs-dotfiles')());","cause":"This middleware is not used in the context of glob-fs.","error":"Error: Must be used with glob-fs"},{"fix":"Change .use(require('glob-fs-dotfiles')) to .use(require('glob-fs-dotfiles')())","cause":"Forgot to call dotfiles() as a function; passed the exported value directly.","error":"Error: Expected a function, but got something else in middleware"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}