1.0.5 • Published 8 years ago
ls-require v1.0.5
ls-require
For each filename piped in, require it. Useful for running tape tests.
install
The normal npm way:
npm install ls-requirewhat it does
For every piped in filename, it will require(filename) it.
That's it.
But why?
Suppose you have a folder like this:
file1.spec.js
file2.spec.jsAnd those files were tape test files, and you wanted to run all of them:
ls *.spec.js | ls-requireOf course, right now you could do tape *.spec.js but tape doesn't
have very expressive minimatch options. Therefore you could use something
like globbit to get a list
of filenames, and execute those as tape tests, like this:
globbit 'path/**/*.spec.js' '!path/**/old-*.spec.js' | ls-requireoptions
The only option currently available is that you can set the current working directory as the first and only property, e.g.:
ls ../*.spec.js | ls-require ../This will require all the piped in files using require('../' + filename).
license
Published and released under the Very Open License.