def update_package_json(newversion):
    p = pathlib.Path('package.json')
    assert p.exists()
    with open(p, 'r') as f:
        json_data = json.loads(f.read())
    json_data['version'] = newversion
    with open(p, 'w') as f:
        f.write(json.dumps(json_data, sort_keys=True, indent=2))
def update_package_json(newversion):
    p = pathlib.Path('package.json')
    assert p.exists()
    with open(p, 'r') as f:
        json_data = json.loads(f.read())
    json_data['version'] = newversion
    with open(p, 'w') as f:
        f.write(json.dumps(json_data, sort_keys=True, indent=2))