{"_id":"files-exist","_rev":"8-05df76c001f0bb4c207e2e5e6e878e53","name":"files-exist","description":"Verify that all the filenames in an array are existing files","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"files-exist","version":"1.0.0","description":"Verify that all the filenames in an array are existing files","main":"lib/files-exist.js","repository":{"type":"git","url":"git+https://github.com/Kaivosukeltaja/files-exist.git"},"scripts":{"test":"mocha","test-cov":"istanbul cover _mocha"},"keywords":["files","exist","glob","build","testing"],"author":{"name":"Niko Salminen"},"license":"MIT","dependencies":{"defaults":"^1.0.3","glob":"^6.0.2"},"devDependencies":{"chai":"^3.4.1","gulp":"^3.9.0","istanbul":"^0.4.1","mocha":"^2.3.4"},"gitHead":"cb575845d798f3f53de0703f533103f1071e7d9e","bugs":{"url":"https://github.com/Kaivosukeltaja/files-exist/issues"},"homepage":"https://github.com/Kaivosukeltaja/files-exist#readme","_id":"files-exist@1.0.0","_shasum":"f4c441307b750b023dab1c71ef369ff2ddadaa68","_from":".","_npmVersion":"2.11.0","_nodeVersion":"0.10.38","_npmUser":{"name":"kaivosukeltaja","email":"npm@salminen.me"},"dist":{"shasum":"f4c441307b750b023dab1c71ef369ff2ddadaa68","tarball":"https://registry.npmjs.org/files-exist/-/files-exist-1.0.0.tgz","integrity":"sha512-l3+Vt5PDL3UDBdtVJWEeD0x98iEuyaeJajfrHjyC+WrcYd8YDzHru5UKDMvJSXBSUSvJ805RXmWpIc9p3cfFew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDvVruZVVgfsyTm4+Sq5k3kfPsplPpBINS1fUwJNw9bAIhAIaOH1K6PotFjXWoBh0+jxBqQmH3ve6e0GvEXQ2Mk4SU"}]},"maintainers":[{"name":"kaivosukeltaja","email":"npm@salminen.me"}],"directories":{}},"1.0.1":{"name":"files-exist","version":"1.0.1","description":"Verify that all the filenames in an array are existing files","main":"lib/files-exist.js","repository":{"type":"git","url":"git+https://github.com/Kaivosukeltaja/files-exist.git"},"bugs":{"url":"https://github.com/Kaivosukeltaja/files-exist/issues"},"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"keywords":["files","exist","glob","build","testing"],"author":{"name":"Niko Salminen"},"license":"MIT","dependencies":{"defaults":"^1.0.3","glob":"^6.0.2"},"devDependencies":{"chai":"^3.4.1","coveralls":"^2.11.6","gulp":"^3.9.0","istanbul":"^0.4.1","mocha":"^2.3.4","mocha-lcov-reporter":"^1.0.0"},"gitHead":"a88bc862ef51998703417e390947981f61efda4c","homepage":"https://github.com/Kaivosukeltaja/files-exist#readme","_id":"files-exist@1.0.1","_shasum":"1461e7ca3707e1772644782a98563802d1b5a8ad","_from":".","_npmVersion":"2.11.0","_nodeVersion":"0.10.38","_npmUser":{"name":"kaivosukeltaja","email":"npm@salminen.me"},"dist":{"shasum":"1461e7ca3707e1772644782a98563802d1b5a8ad","tarball":"https://registry.npmjs.org/files-exist/-/files-exist-1.0.1.tgz","integrity":"sha512-F1ITl5m/RdoJ3YZprzc2jGd8YQlFEhqN0FTK8buIvFi9XGqnAS6bwLXi6iqZYHtE0JJlljaZpTuoqQAsrZXj3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7R17JecgdINeeP1lsi4pWSf9WLG76GfFxEaUx9wpbvgIgd8rEEBxdR81Py48NrDuJTGSh48CZGsndzue7tf8xQwE="}]},"maintainers":[{"name":"kaivosukeltaja","email":"npm@salminen.me"}],"directories":{}},"1.0.2":{"name":"files-exist","version":"1.0.2","description":"Verify that all the filenames in an array are existing files","main":"lib/files-exist.js","repository":{"type":"git","url":"git+https://github.com/Kaivosukeltaja/files-exist.git"},"bugs":{"url":"https://github.com/Kaivosukeltaja/files-exist/issues"},"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"keywords":["files","exist","glob","build","testing"],"author":{"name":"Niko Salminen"},"license":"MIT","dependencies":{"defaults":"^1.0.3","glob":"^6.0.2"},"devDependencies":{"chai":"^3.4.1","coveralls":"^2.11.6","gulp":"^3.9.0","istanbul":"^0.4.1","mocha":"^2.3.4","mocha-lcov-reporter":"^1.0.0"},"gitHead":"cfafb7f1883417a234c6c47ed737c3f793e5f9ae","homepage":"https://github.com/Kaivosukeltaja/files-exist#readme","_id":"files-exist@1.0.2","_shasum":"b0258dd6223b77f5014926f9d80d9a48f9ffd422","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.3.1","_npmUser":{"name":"kaivosukeltaja","email":"npm@salminen.me"},"dist":{"shasum":"b0258dd6223b77f5014926f9d80d9a48f9ffd422","tarball":"https://registry.npmjs.org/files-exist/-/files-exist-1.0.2.tgz","integrity":"sha512-raNpZqFGgvQT9hmt5wRXxL9cUQBYI1osMFvkRMk344xLLOOBoLsObvx8I134G4lQ3EfgaZbgqLD0t9gVqH7AKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG6/PObX8mtYJxa3B1P5U7KRI9TyuqcCUdSfbf7XegBoAiEAk+FO1Nyr84lH4PY0T/n6VNJI7DULdQehQDNBwzoqitg="}]},"maintainers":[{"name":"kaivosukeltaja","email":"npm@salminen.me"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/files-exist-1.0.2.tgz_1478081394538_0.06087475339882076"},"directories":{}},"1.1.0":{"name":"files-exist","version":"1.1.0","description":"Verify that all the filenames in an array are existing files","main":"lib/files-exist.js","repository":{"type":"git","url":"git+https://github.com/Kaivosukeltaja/files-exist.git"},"bugs":{"url":"https://github.com/Kaivosukeltaja/files-exist/issues"},"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"keywords":["files","exist","glob","build","testing"],"author":{"name":"Niko Salminen"},"license":"MIT","dependencies":{"defaults":"^1.0.3","glob":"^6.0.2"},"devDependencies":{"chai":"^3.4.1","coveralls":"^2.11.6","gulp":"^3.9.0","istanbul":"^0.4.1","mocha":"^2.3.4","mocha-lcov-reporter":"^1.0.0"},"gitHead":"666be33a31d1edad84b6c095fffa0d30ace99be7","homepage":"https://github.com/Kaivosukeltaja/files-exist#readme","_id":"files-exist@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.7.0","_npmUser":{"name":"kaivosukeltaja","email":"npm@salminen.me"},"dist":{"integrity":"sha512-FG9ZrkR5Ek6s+2MHe5ljMwEz2/gWOTNIh+qboHFgc49DZJIOZMwJVwMvH/Sn0ifHELrAKPy7bvKfHOL8ZcmDmQ==","shasum":"a8bc9e006ad797c8ab85d10a3613ca45abff8e75","tarball":"https://registry.npmjs.org/files-exist/-/files-exist-1.1.0.tgz","fileCount":7,"unpackedSize":11152,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTHRDNJ9e97j09sZs5JQM+98zsX30ikSrcZCgu1BuNwgIgcQcoo78aAuoA5PQNPOIQ0igm7dKl/Dmahz6hfJLKRWU="}]},"maintainers":[{"name":"kaivosukeltaja","email":"npm@salminen.me"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/files-exist_1.1.0_1523364022477_0.6081975333954266"},"_hasShrinkwrap":false}},"readme":"# files-exist\n\n[![Coverage Status](https://coveralls.io/repos/Kaivosukeltaja/files-exist/badge.svg?branch=master&service=github)](https://coveralls.io/github/Kaivosukeltaja/files-exist?branch=master)\n[![Build Status](https://travis-ci.org/Kaivosukeltaja/files-exist.svg?branch=master)](https://travis-ci.org/Kaivosukeltaja/files-exist)\n\nThis simple tool accepts an array of filenames (or a single filename as a string) with or without globbing wildcards and returns an identical array if all the filenames point to existing files on the file system.\n\nBasic usage:\n```javascript\nvar filesExist = require('files-exist'),\nfiles = filesExist(['package.json', 'node_modules/express/lib/express.js']);\n```\n\n## Usage in unit testing\nYou can use `files-exist`in your unit tests. Simply pass an array of files you want to exist and either check for errors or disable them and compare the array returned.\n```javascript\nvar chai = require('chai'),\nfilesExist = require('files-exist');\n\ndescribe('images', function() {\n  it('should contain at least one .png file', function() {\n    var files = 'images/*.png';\n\n    // Method one: pass a bound call and check for thrown errors\n    chai.expect(filesExist.bind(filesExist, files, { checkGlobs: true })).to.not.throw(Error);\n\n    // Method two: suppress errors and check the returned results\n    var results = filesExist(files, { checkGlobs: true, throwOnMissing: false });\n    chai.expect('images/*.png' in results).to.not.equal(false);\n  });\n});\n```\n\n## Usage in build process\nUse `files-exist` around your `gulp.src()` source files to notice when a soft dependency is broken. This can help you to spot newly added [bower](http://bower.io/) components that haven't been installed on your local machine yet.\n\n```javascript\nvar jsLibs = [\n    'vendor/jquery/dist/jquery.js',\n    'vendor/jquery.stellar/jquery.stellar.min.js',\n    'vendor/autofill-event/src/autofill-event.js',\n    'vendor/js-cookie/src/js.cookie.js',\n    'vendor/modernizr/modernizr.js',\n    'vendor/lodash/lodash.js',\n    'app/*.js',\n    '!app/config.js' // Items starting with an exclamation point are ignored\n];\n\ngulp.task('build:js', function() {\n  return gulp.src(filesExist(jsLibs, { exceptionMessage: 'Please run `bower install` to install missing library' }))\n  .pipe(gulp.dest(outputPath + '/js'));\n});\n```\n\n## Options\n\n### checkGlobs\n\nBy default, `files-exist` doesn't check whether globs match any files. Set this to `true` to enable glob evaluation.\n\n### onMissing\n\nYou can pass a callback function that gets called for every missing file. It will get one parameter, the name of the file or pattern that was not found. If you want to trigger an error, you may throw or return `false` from the callback.\n\n```\noptions = { onMissing: function(file) {\n  throw new TestError('Custom error for missing file: ' + file);\n}};\n```\n\nOr alternatively:\n\n```\noptions = { onMissing: function(file) {\n  console.log('File not found: ' + file);\n  return false;\n}};\n```\n\n### throwOnMissing\n\nSet this to `false` if you don't want `files-exist` to throw any exceptions when missing files are encountered. Note that you'll need to check the returned array yourself in this case, as it will be returned without the missing files.\n\n### exceptionClass\n\nSet the name of the exception class you want to use for the error message. Defaults to `Error`.\n\n### exceptionMessage\n\nCustomize the message of the exception. The name of the first missing file encountered will be appended.\n\n# Thanks\n- [MartinKei](https://github.com/MartinKei) for string parameter and option to ignore files\n","maintainers":[{"name":"kaivosukeltaja","email":"npm@salminen.me"}],"time":{"modified":"2022-06-18T00:44:46.116Z","created":"2015-12-28T11:32:45.064Z","1.0.0":"2015-12-28T11:32:45.064Z","1.0.1":"2015-12-28T13:24:45.979Z","1.0.2":"2016-11-02T10:09:56.342Z","1.1.0":"2018-04-10T12:40:22.531Z"},"homepage":"https://github.com/Kaivosukeltaja/files-exist#readme","keywords":["files","exist","glob","build","testing"],"repository":{"type":"git","url":"git+https://github.com/Kaivosukeltaja/files-exist.git"},"author":{"name":"Niko Salminen"},"bugs":{"url":"https://github.com/Kaivosukeltaja/files-exist/issues"},"license":"MIT","readmeFilename":"README.md","users":{"kiinlam":true}}