Registry / storage / swift-storage

swift-storage

JSON →
library2.2.1jsnpmunverified

Swift Storage is a storage service library for interacting with OpenStack Swift object storage. Current stable version is 2.2.1. Release cadence is not specified. Differentiators: provides a straightforward API for common Swift operations like container and object management. Primarily used in cloud infrastructure and DevOps workflows.

npm install swift-storage
INSTALL
IMPORT
SIG · SWIFT-STORAGE
S
swift-storage
storagejavascriptv2.2.1
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.

SwiftStorage
import SwiftStorage from 'swift-storage'
const SwiftStorage = require('swift-storage');
ESM-only; no CommonJS support.
Container
import { Container } from 'swift-storage'
import Container from 'swift-storage'
Named export for Container class.
SwiftClient
import { SwiftClient } from 'swift-storage'
import SwiftClient from 'swift-storage';
Named export; not the default export.

Initialize a SwiftStorage client, create a container, and list containers.

import SwiftStorage from 'swift-storage'; const storage = new SwiftStorage({ authUrl: process.env.SWIFT_AUTH_URL ?? 'http://localhost:8080/auth/v1.0', username: process.env.SWIFT_USERNAME ?? 'test:tester', password: process.env.SWIFT_PASSWORD ?? 'testing' }); async function main() { await storage.createContainer('my-container'); const containers = await storage.listContainers(); console.log('Containers:', containers); } main().catch(console.error);
Debug
Known issues
gotchaDefault export is ESM-only; require() will fail.
fix
Use ESM import syntax or switch to a CJS-compatible version.
affects: >=2.0
deprecatedThe v1 authentication endpoint is deprecated; use v2 or v3.
fix
Update authUrl to use a v2 or v3 endpoint.
affects: >=1.0
breakingConstructor options changed in v2: 'endpoint' renamed to 'authUrl'.
fix
Use 'authUrl' instead of 'endpoint'.
affects: >=2.0 <3
Errors
Common errors & fixes
TypeError: SwiftStorage is not a constructor
Using CommonJS require() instead of ESM import.
fix
Use 'import SwiftStorage from 'swift-storage'' in an ESM context.
Error: Missing required parameter 'authUrl'
The constructor expects an 'authUrl' property, but 'endpoint' was provided.
fix
Change 'endpoint' to 'authUrl' in the options object.
Upgrade
Version history
2.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
28
Resources
swift-storage — npm install swift-storage · libregistry