Create new JavaScript files with all your requires required.
How to use / build
For this README you'll learn how to make reqchoir. Then you will know how to use it.
Create a new repo, clone it and cd into it.
From the command line in the root directory of your repo:
echo -e '#reqchoir\n\nCreate new JavaScript files with all your requires required.\n\n####Usage\n\n' > README.md
npm adduser
npm init
Add to your package.json the property:
test: npm test.config.js test/*.js | faucet
npm i --save-dev tape pre-commit faucet
From the command line in the root directory of your repo:
echo node\/modules\/* > .gitignore
Add to package.json
the property:
pre-commit: test
write test.config
, which will load all the files in /test
and pipe them through tape into stdout:
var test = ;var path = ; test; processargv;
create index.js
and test/index.test.js
write a passing version of test/index.test.js
:
var test = ; ;
npm i -s string-to-stream concat-stream
Here's index.js
:
var file = ;var modules = processargv; var rechoir = modules; var str = ;var ws = ;;
Use index.js
as a template to write a test in index.test.js
:
var test = ;var concat = ; var modules = 'through2' 'concat-stream' 'ecstatic'; var rechoir = modules; var testFile = "var through2 = require('through2');\n" +"var concat-stream = require('concat-stream');\n" +"var ecstatic = require('ecstatic');"; var str = ;var writeableStream = ; ;
If you're publishing to npm, test it locally:
npm i -g ./
mkdir local_test/
cd temp/
reqchoir yes.js through2 trumpet fs hyperquest
confirm it worked:
cat yes.js
clean up:
cd ..
rm -rf local_test/
And finally:
npm publish