Registry / storage / azure-table-node

azure-table-node

JSON →
library1.5.0jsnpmunverified

Simplified Azure Table Storage client library for NodeJS using JSON on the wire. Current stable version is 1.5.0. Supports creating, deleting, and listing tables; creating, updating, querying, and deleting entities; batch operations; and generating/using SAS for authentication. Unlike the official @azure/data-tables SDK, this library aims for simplicity and uses a callback-based API. It reads connection info from environment variable CLOUD_STORAGE_ACCOUNT by default. No major release cadence documented; last update appears older. Differentiator: lightweight, no dependency on the large Azure SDK monorepo, but lacks promised features like service properties and had known parsing issues with the connection string.

npm install azure-table-node
INSTALL
IMPORT
SIG · AZURE-TABLE-NODE
A
azure-table-node
storagejavascriptv1.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
var azureTable = require('azure-table-node');
import azureTable from 'azure-table-node';
This package uses CommonJS; no default ESM export. Use require().
Query
var azureTable = require('azure-table-node'); var Query = azureTable.Query;
var Query = require('azure-table-node').Query;
Query is a static property on the main export. Proper usage: azureTable.Query.create(...).
createClient
var azureTable = require('azure-table-node'); var client = azureTable.createClient({...});
var client = require('azure-table-node').createClient(...);
createClient is a method on the main export. Do not require directly.
getDefaultClient
var azureTable = require('azure-table-node'); var client = azureTable.getDefaultClient();
var client = new (require('azure-table-node').Client)();
No Client constructor exported. Use getDefaultClient() or createClient().

Shows how to require, configure with environment variables, create a table, insert an entity, and query entities using callbacks.

var azureTable = require('azure-table-node'); // Configure default client (or rely on CLOUD_STORAGE_ACCOUNT env var) azureTable.setDefaultClient({ accountUrl: 'https://' + (process.env.STORAGE_ACCOUNT_NAME ?? '') + '.table.core.windows.net/', accountName: process.env.STORAGE_ACCOUNT_NAME ?? '', accountKey: process.env.STORAGE_ACCOUNT_KEY ?? '' }); var client = azureTable.getDefaultClient(); // Create a table client.createTable('testtable', true, function(err, data) { if (err) { console.error(err); return; } console.log('Table created:', data); }); // Insert an entity client.insertEntity('testtable', { PartitionKey: 'tests', RowKey: 'insert', value1: 'ABCDEFG' }, function(err, data) { if (err) { console.error(err); return; } console.log('Entity inserted, etag:', data.etag); }); // Query entities client.queryEntities('testtable', { query: azureTable.Query.create('PartitionKey', '==', 'tests'), limitTo: 20 }, function(err, data, continuation) { if (err) { console.error(err); return; } console.log('Entities:', data); if (continuation) console.log('More data available'); });
Debug
Known issues
gotchaEnvironment variable CLOUD_STORAGE_ACCOUNT parsing is fragile: AccountKey must be last, no quotes supported.
fix
Manually set connection via setDefaultClient() or ensure connection string format with AccountKey last.
affects: <=1.5.0
breakinggetEntity requires PartitionKey and RowKey as separate string arguments, not an object.
fix
client.getEntity('table', 'partitionKey', 'rowKey', callback);
affects: <=1.5.0
deprecatedThe official Azure SDK (@azure/data-tables) is recommended for new projects; this library is no longer actively maintained.
fix
Migrate to @azure/data-tables for ESM support, promises, and active development.
affects: >=1.0.0
gotchaBatch operations use a chaining API with .updateEntity(), .deleteEntity() etc., but must end with .commit() - operations are not sent until commit.
fix
Always call .commit(callback) after chaining operations or they are lost.
affects: <=1.5.0
gotchaThe etag for deleteEntity must be provided as __etag property (double underscore), not etag.
fix
Include __etag: 'W/"datetime..."' when calling deleteEntity.
affects: <=1.5.0
Errors
Common errors & fixes
Cannot read property 'table' of undefined
Trying to call client methods without initializing a client via getDefaultClient() or createClient().
fix
var client = azureTable.getDefaultClient(); // then use client methods
getEntity requires partition key and row key arguments
getEntity signature expects three string args (table, partitionKey, rowKey), not an object.
fix
client.getEntity('mytable', 'partition1', 'row1', callback);
parseCLOUD_STORAGE_ACCOUNT: AccountKey must be last
The connection string parser requires AccountKey to be the final part; otherwise it fails silently.
fix
Reformat connection string: TableEndpoint=...;AccountName=...;AccountKey=... (AccountKey last).
Query is not a constructor
Query is not instantiated with new; it is used via Query.create().
fix
Use azureTable.Query.create('field', '==', 'value') instead of new Query().
Upgrade
Version history
1.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
54 hits · last 30 days
node
48
Resources
azure-table-node — npm install azure-table-node · libregistry