#!/bin/sh -x
rm -f package*
rm -rf node_modules
npm install mqtt
version=`grep '"version":' node_modules/mqtt/package.json  | sed -e 's;.*: ";;' -e 's;".*;;'`
date=`date '+%Y%m%d'`
tar cvf - node_modules | xz -9 >mqtt-$version-$date.tar.xz
rm -rf node_modules
