fix example code
improve unit test
improve file detection
update devDependencies and scripts