added input option and refactored npm build