seneca-basic is a foundational utility plugin for the Seneca.js microservices framework. It provides a small, essential set of action patterns for internal per-process communication, primarily through a 'notes' mechanism, allowing plugins to store and retrieve keyed values or lists. These patterns include `set`, `get`, `push`, `list`, and `pop` for `role:basic, note:true` actions. The package is often bundled by default within the main `seneca` module, simplifying its integration for most users. Its current stable version is 1.0.0, though the latest detailed release notes visible are from v0.5.0 in 2016, indicating a mature and stable, rather than rapidly evolving, project. Release cadence is infrequent, likely tied to Seneca's own maintenance cycles. Its key differentiator is its tightly integrated role within the Seneca ecosystem, providing a lightweight, built-in mechanism for internal plugin coordination without external dependencies.
npm install seneca-basicVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes Seneca, explicitly loads the seneca-basic plugin, and demonstrates setting, getting, pushing, listing, and popping 'note' values.
Upgrade your Node.js runtime to version 6 or newer. The current recommended Node.js LTS version is generally advised for all Seneca.js projects.
When initializing Seneca for explicit loading, pass `{ default_plugins: { 'basic': false } }` as a configuration option: `const seneca = require('seneca')({ default_plugins: { 'basic': false } })`.Use CommonJS `require()` statements for importing `seneca` and `seneca-basic`. If you must use ESM, consider using `createRequire` from the `module` package or a build tool like Webpack/Rollup that can handle CommonJS modules in an ESM project.
For persistent data storage, inter-service communication, or public APIs, utilize dedicated Seneca patterns like `role:entity` for data persistence or define specific service endpoints for API interactions.
Ensure your file is treated as a CommonJS module (e.g., `.js` file without `"type": "module"` in `package.json`, or explicitly `.cjs` extension). Alternatively, if using ESM, use `import()` or `createRequire` for compatibility.
When initializing Seneca, disable the default `basic` plugin: `const seneca = require('seneca')({ default_plugins: { 'basic': false } })`.Verify that `seneca.use(require('seneca-basic'))` is correctly called and that no errors occurred during plugin loading. Ensure `default_plugins.basic` is set to `false` if loading explicitly.