remove trailing space and support auto-updating of package.json
ops, fix syntax