Registry / database / rm
library0.1.8jsnpmunverified

An ORM-like object storage layer for Riak, version 0.1.8. Provides a simple API for storing and retrieving JSON objects in Riak with schema stored in the database. No SQL, no complexity—just basic CRUD operations via promises. Designed for Node.js, relies on riak-dc for HTTP communication with Riak. Release cadence unknown; last update likely circa 2014. Differentiator: minimalistic, synchronous-like API using Q promises, no relational features, schema-light. Not actively maintained.

npm install rm
INSTALL
IMPORT
SIG · RM
R
rm
databasejavascriptv0.1.8
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.

rm
✓ import rm from 'rm'
✗ const rm = require('rm')
ESM default import; commonjs require also works but not recommended
add_object
✓ import { add_object } from 'rm'
✗ import rm from 'rm'; rm.add_object
Named export, can also use default and destructure
get_objects
✓ import { get_objects } from 'rm'
Named export
del_object
✓ import { del_object } from 'rm'
Named export

Demonstrates basic CRUD: adding an object, retrieving all objects of a type, and deleting an object using the RM library with riak-dc configured for a local Riak instance.

import rm from 'rm'; import riakdc from 'riak-dc'; // configure riak-dc if not using default localhost:8098 riakdc.init({ host: 'localhost', port: 8098 }); // add a new object rm.add_object('automobile', { make: 'Toyota', model: 'Camry', year: 2020 }) .then(obj => { console.log('Saved with serial:', obj.serial); }) .catch(err => console.error(err)); // get all objects of a type rm.get_objects('automobile') .then(objs => { objs.forEach(o => console.log(o.make, o.model)); }); // delete an object (must have serial) rm.del_object('automobile', { serial: 'some-serial' }) .then(() => console.log('Deleted'));
Debug
Known issues
abandonedPackage is abandoned; no updates since 2014. May have security vulnerabilities in dependencies (e.g., q, riak-dc).
fix
Migrate to a maintained Riak client or alternative ORM.
affects: >=0.0.0
gotchaObjects must have a 'serial' property to be updated or deleted; otherwise an exception is thrown.
fix
Ensure objects retrieved via get_objects have serials; for new objects, serial is assigned after add_object.
affects: >=0.0.0
gotchaSchema is not enforced; objects can violate the schema template.
fix
Validate objects manually before storing.
affects: >=0.0.0
deprecatedUses Q promises, which are outdated; modern code should use native Promises or async/await.
fix
Wrap Q promises with native Promise or use a promise wrapper.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Object already exists
Calling add_object on an object that already has a serial or is duplicate.
fix
Use update_object instead for existing objects.
Error: Object has no serial
Calling del_object or update_object on an object without a serial property.
fix
Ensure object has a serial (from a prior add_object or get_objects).
TypeError: Cannot read property 'init' of undefined
riak-dc not installed or imported.
fix
Run npm install riak-dc and import riakdc before using rm.
Upgrade
Version history
0.1.8latest on npm
Audit
Dependencies
riak-dcrequiredHTTP client for Riak
qrequiredPromise library
Agent activity
10 hits · last 30 days
node
8
Meta
1
Amazon
1
Resources
packagerm ↗
rm — npm install rm · libregistry