Registry / storage / filesystem-storage-pkgcloud

filesystem-storage-pkgcloud

JSON →
library1.2.0jsnpmunverified

Provides a filesystem storage provider for the pkgcloud multi-cloud storage library, based on loopback-storage-service. Version 1.2.0 is the latest stable release; development appears dormant with no recent updates on GitHub. It allows using local filesystem as a storage backend, either standalone or registered as a pkgcloud provider. Key differentiator: enables local development/testing with pkgcloud's unified API without needing real cloud credentials.

npm install filesystem-storage-pkgcloud
INSTALL
IMPORT
SIG · FILESYSTEM-STORAGE
F
filesystem-storage-pkgcloud
storagejavascriptv1.2.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.

filesystem-storage-pkgcloud
✓ const filesystem = require('filesystem-storage-pkgcloud');
✗ const filesystem = require('filesystem-storage-pkgcloud').default;
CommonJS module; no default export.
pkgcloud.providers.filesystem.storage
✓ pkgcloud.providers.filesystem.storage = require('filesystem-storage-pkgcloud');
✗ import filesystem from 'filesystem-storage-pkgcloud'; pkgcloud.providers.filesystem.storage = filesystem;
ESM import may not work; use require for pkgcloud integration.
createClient
✓ const client = require('filesystem-storage-pkgcloud').createClient({ root: '/tmp/storage' });
✗ const client = new require('filesystem-storage-pkgcloud').Client({ root: '/tmp/storage' });
createClient is a static factory function, not a constructor.

Shows how to register the filesystem provider with pkgcloud, upload a file, and list containers.

const fs = require('fs'); const path = require('path'); const pkgcloud = require('pkgcloud'); const filesystemProvider = require('filesystem-storage-pkgcloud'); pkgcloud.providers.filesystem = {}; pkgcloud.providers.filesystem.storage = filesystemProvider; const client = pkgcloud.storage.createClient({ provider: 'filesystem', root: path.join(__dirname, 'test-storage') }); // Ensure root directory exists if (!fs.existsSync(client.config.root)) { fs.mkdirSync(client.config.root, { recursive: true }); } // Upload example const container = 'test-container'; const remoteFile = 'hello.txt'; const localFile = path.join(__dirname, 'hello.txt'); fs.writeFileSync(localFile, 'Hello World!'); client.upload({ container: container, remote: remoteFile, local: localFile }, function(err, result) { if (err) return console.error(err); console.log('Uploaded:', result); // Cleanup fs.unlinkSync(localFile); fs.rmdirSync(path.join(client.config.root, container), { recursive: true }); }); // List containers client.getContainers(function(err, containers) { if (err) return console.error(err); console.log('Containers:', containers); });
Debug
Known issues
gotchaThe root directory must exist before client creation; client does not create it automatically.
fix
Create the root directory manually with fs.mkdirSync({ recursive: true })
affects: >=1.0
gotchaOnly path-style configuration; does not support URL or environment variable based root paths.
fix
Pass root as an absolute path string
affects: >=1.0
gotchaAll file operations occur under root; there is no support for cloud provider features like region, replication, or ACLs.
fix
Use for local testing only; switch to real pkgcloud provider for production
affects: >=1.0
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open '/nonexistent/file.txt'
Attempting to read a file that does not exist in the storage root.
fix
Ensure the file exists before reading, or check for existence with client.getFile()
TypeError: client.createClient is not a function
Using require('filesystem-storage-pkgcloud').createClient directly when it is an object with createClient property.
fix
Use require('filesystem-storage-pkgcloud').createClient(...) correctly.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
csvoptionalCSV parsing dependency via loopback-storage-service
Agent activity
30 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
filesystem-storage-pkgcloud — npm install filesystem-storage-pkgcloud · libregistry