write library file for _client