How to use the ignore-by-default.directories function in ignore-by-default

To help you get started, we’ve selected a few ignore-by-default examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github avajs / ava / test / watcher.js View on Github external
'use strict';
const path = require('path');
const EventEmitter = require('events');
const {PassThrough} = require('stream');
const defaultIgnore = require('ignore-by-default').directories();
const lolex = require('lolex');
const proxyquire = require('proxyquire');
const sinon = require('sinon');
const {test} = require('tap');
const {normalizeGlobs} = require('../lib/globs');
const {setImmediate} = require('../lib/now-and-timers');

require('../lib/chalk').set({});

// Helper to make using beforeEach less arduous
function makeGroup(test) {
	return (desc, fn) => {
		test(desc, t => {
			const beforeEach = fn => {
				t.beforeEach(done => {
					fn();
github errorception / staticify / index.js View on Github external
'use strict';

const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const url = require('url');

const ignoredDirectories = require('ignore-by-default').directories();
const memoizee = require('memoizee');
const send = require('send');

const MAX_AGE = 1000 * 60 * 60 * 24 * 365; // 1 year in milliseconds
const SHORT_LEN = 7;
const LONG_LEN = 32;

const staticify = (root, options) => {
    let sendOptsNonVersioned;

    const setOptions = (opts = {}) => {
        let defaultOptions = {
            includeAll: opts.includeAll || false,
            shortHash: opts.shortHash || true,
            pathPrefix: opts.pathPrefix || '/',
            maxAgeNonHashed: opts.maxAgeNonHashed || 0,
github remy / nodemon / lib / config / defaults.js View on Github external
var ignoreRoot = require('ignore-by-default').directories();

// default options for config.options
module.exports = {
  restartable: 'rs',
  colours: true,
  execMap: {
    py: 'python',
    rb: 'ruby',
    ts: 'ts-node',
    // more can be added here such as ls: lsc - but please ensure it's cross
    // compatible with linux, mac and windows, or make the default.js
    // dynamically append the `.cmd` for node based utilities
  },
  ignoreRoot: ignoreRoot.map(_ => `**/${_}/**`),
  watch: ['*.*'],
  stdin: true,
github avajs / ava / lib / ava-files.js View on Github external
'use strict';
const fs = require('fs');
const path = require('path');
const Promise = require('bluebird');
const slash = require('slash');
const globby = require('globby');
const flatten = require('lodash.flatten');
const defaultIgnore = require('ignore-by-default').directories();
const multimatch = require('multimatch');

function handlePaths(files, extensions, excludePatterns, globOptions) {
	// Convert Promise to Bluebird
	files = Promise.resolve(globby(files.concat(excludePatterns), globOptions));

	const searchedParents = new Set();
	const foundFiles = new Set();

	function alreadySearchingParent(dir) {
		if (searchedParents.has(dir)) {
			return true;
		}

		const parentDir = path.dirname(dir);

ignore-by-default

A list of directories you should ignore by default

ISC
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Popular ignore-by-default functions