Registry / storage / loopback-storage-service

loopback-storage-service

JSON →
library1.0.4jsnpmunverified

A LoopBack component for managing binary files via pluggable storage providers (local filesystem, Amazon S3, Rackspace, OpenStack, Azure). Current version 1.0.4 is stable but unmaintained; no releases since 2016. It wraps pkgcloud to abstract cloud storage, exposing both Node.js and REST APIs for container and file operations. The project is part of the deprecated StrongLoop/LoopBack ecosystem and has been superseded by loopback-component-storage (for LoopBack 3.x). Not recommended for new projects.

npm install loopback-storage-service
INSTALL
IMPORT
SIG · LOOPBACK-STORAGE-S
L
loopback-storage-service
storagejavascriptv1.0.4
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.

createDataSource
import { createDataSource } from 'loopback-datasource-juggler';
const createDataSource = require('loopback').createDataSource;
This package is a LoopBack connector; you typically use it via loopback-datasource-juggler's createDataSource, not directly.
loopback-storage-service
const ds = loopback.createDataSource({ connector: require('loopback-storage-service'), provider: 'filesystem', root: '/tmp' });
const ds = loopback.createDataSource('loopback-storage-service', { provider: 'filesystem' });
The connector must be passed as an object literal with the 'connector' key; passing the name alone will not work.
container model
const Container = ds.createModel('container');
const Container = ds.define('container', {});
The model must be created via createModel with the name 'container' to get the mixed-in storage methods.

Shows setting up a LoopBack data source with the filesystem provider and listing all containers.

const loopback = require('loopback'); const path = require('path'); const ds = loopback.createDataSource({ connector: require('loopback-storage-service'), provider: 'filesystem', root: path.join(__dirname, 'storage') }); const Container = ds.createModel('container'); Container.getContainers((err, containers) => { if (err) console.error(err); else console.log(containers); });
Debug
Known issues
deprecatedThis package is no longer maintained. Use loopback-component-storage for LoopBack 3.x or consider an alternative.
fix
Migrate to loopback-component-storage (npm install loopback-component-storage).
affects: >=0.0.0
breakingWhen using the filesystem provider, the 'root' path must be absolute. Relative paths cause silent failures.
fix
Use path.resolve(__dirname, 'storage') to provide an absolute path.
affects: >=0.0.0
gotchaThe model must be named exactly 'container' to receive the storage methods. Other model names will not work.
fix
Use ds.createModel('container') instead of a custom model name.
affects: >=0.0.0
breakingpkgcloud dependency may have incompatible versions. The package does not pin a specific version of pkgcloud.
fix
Specify a compatible pkgcloud version in your package.json (e.g., pkgcloud@1.x).
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'loopback-storage-service'
Package not installed or not in node_modules.
fix
Run 'npm install loopback-storage-service' and ensure it is in your dependencies.
Error: Provider "filesystem" is not supported
The provider name is misspelled or the pkgcloud module is missing a required dependency.
fix
Check spelling: use 'filesystem', 'amazon', 'rackspace', 'openstack', or 'azure'. Install loopback-storage-service and pkgcloud.
TypeError: ds.createModel is not a function
LoopBack datasource juggler is not installed or not used correctly.
fix
Install loopback-datasource-juggler: 'npm install loopback-datasource-juggler' and use it with loopback.
Error: ENOENT: no such file or directory, open '/tmp/storage/...'
The root directory for the filesystem provider does not exist.
fix
Create the directory manually or use a path that exists. For cloud providers, check credentials.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
pkgcloudrequiredProvides the underlying cloud storage client for Amazon, Rackspace, OpenStack, Azure
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
loopback-storage-service — npm install loopback-storage-service · libregistry