I needed an example for someone of how to use Typescript and NodeJS who needed to do some file processing. Thus, a wee template for streaming a set of files through a handler.
If you are batch processing files that change or land in a folder, and you'd like to just 'watch' a folder and execute the batch whenever there is a matching change... this template is for you.
It also demonstrates file handling, injection, using Typescript with NodeJS (which is pretty common nowadays, but was rather novel back when this was first created).
Assuming you're starting from zero, you'll need a few things. NodeJs, a development environment. Links follow.
- Git: https://git-scm.com/downloads (or perhaps https://desktop.github.com if you prefer)
- WebStorm: https://www.jetbrains.com/webstorm/download/
- nodeenv: https://github.com/nodenv/nodenv
Once you've installed all of the above, clone this project and get started:
mkdir -p ~/github/youAtGithub/
cd ~/github/youAtGithub/
git clone [email protected]:ggranum/nodejs-file-processor-template.git my-file-processor
cd my-file-processor
# Remove the git directory so you can make this project yours
rm -rf ./.git
git init .
git add .
git commit -am "My New project, cloned from [email protected]:ggranum/nodejs-file-processor-template.git"
npm install