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
✓ const Seneca = require('seneca'); const seneca = Seneca(); seneca.use('mem-store');
✗ const Seneca = require('seneca-mem-store');
This is a plugin, not a standalone module.
TypeScript types
✓ import Seneca from 'seneca'; const seneca = Seneca(); seneca.use('mem-store');
✗ import senecaMemStore from 'seneca-mem-store';
TypeScript types are shipped, but usage is through Seneca instance.
Plugin registration
✓ seneca.use('mem-store')
✗ seneca.use(require('seneca-mem-store'))
The plugin is auto-loaded if you use seneca-entity; explicit use() is optional.
Demonstrates creating an entity, saving it to the in-memory store, and loading it back by id.
const Seneca = require('seneca');
const seneca = Seneca();
seneca.use('basic').use('entity');
// mem-store is loaded by default, no explicit use() needed.
seneca.ready(() => {
const apple = seneca.make$('fruit');
apple.name = 'Pink Lady';
apple.price = 0.99;
apple.save$((err, saved) => {
console.log('Saved with id:', saved.id);
// load it back
seneca.make$('fruit').load$({ id: saved.id }, (err2, loaded) => {
console.log('Loaded:', loaded.name);
});
});
});
Debug
Known issues
breakingIn version 9.x, the plugin is ESM-only. Any require() will fail on Node.js versions that don't support ESM fully.fixUse import syntax or upgrade to Node.js 14+ with --experimental-modules flag (deprecated) or use dynamic import.
affects: >=9.0.0
breakingSeneca 4.x version requires changes in plugin registration (use('mem-store') instead of older patterns).fixEnsure you are using Seneca 3.x or 4.x with compatible API.
affects: >=9.0.0 && <10.0.0
deprecatedThe older Seneca 2.x support was dropped after version 8.x.fixUpgrade to Seneca 3.x or higher.
affects: >=9.0.0
gotchaData does not persist between runs. Do not use for production data.fixUse a persistent store plugin like seneca-postgres-store for production.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'seneca-mem-store'
Trying to require the plugin directly as a standalone module.
fixInstall seneca and seneca-mem-store, then use seneca.use('mem-store'). TypeError: seneca.make$ is not a function
Missing the seneca-entity plugin.
fixAdd seneca.use('entity') after basic plugin. Error: Plugin mem-store not found
mem-store not installed or not registered via use().
fixRun npm install seneca-mem-store and add seneca.use('mem-store'). Audit
Dependencies
senecarequiredCore Seneca framework required to use the plugin.
seneca-entityrequiredProvides the ActiveRecord-style data storage API that this plugin implements.