Since Midrosoft is dropping support for library
azure-storage, they've been slow to provide an updated, promise-based library for tables. With Azure Storage Tables being widely used, a promise-wrapper seemed like a good idea to reduce code redundancy between projects. We were wrapping methods left and right, project by project, and sometimes not doing a great job of being consistent and re-using code. This module allows users to consistently access the TableService API without further dependencies beyond just
- Install from NPM:
npm install --save azure-table-promise
- Import it into your project using
TableService and provides the exact same API with every callback-style function wrapped in a promise.
See the docs for
azure-storage for complete details of each function and its arguments. Always omit the callback, as the promise automatically will either resolve with the response of the callback, or reject with the callback error.
PromiseTableService~queryEntitiesAll<T>(table: string, tableQuery: TableQuery, options?: TableService.TableEntityRequestOptions): Promise<TableService.QueryEntitiesResult<T>>
Adds support for a fetch-all query by paging through results of method
Method which wraps
createTableService for API completeness.
createTableService (alias of
azure namespace for convenience, which includes all untouched functions, classes, and constants from library
resolveEntity: boolean to options for
queryEntitiesAll methods; automatically uses internal
entityResolver function when set to
Tests and Code Coverage
This library features 100% code coverage, but this is more a feature of the dynamic instantiation of functions than it is an indicator of test completeness. The tests rely on Azurite V2 for validating that the promises work; once Azurite V3 supports Storage Tables it is expected that Microsoft will have released a promise-based library, which in turn removes the need for this library.
- Aaron Huggins