For each filename piped in, require it. Useful for running tape tests.
The normal npm way:
npm install ls-require
For every piped in filename, it will require(filename)
it.
That's it.
Suppose you have a folder like this:
file1.spec.js
file2.spec.js
And those files were tape test files, and you wanted to run all of them:
ls *.spec.js | ls-require
Of 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-require
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)
.
Published and released under the Very Open License.