
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
abstract-skiff-persistence
Advanced tools
Abstract prototype for building a Skiff persistence provider.
$ npm install abstract-skiff-persistence
## Implement
```javascript
var AbstractSkiffPersistence = require('abstract-skiff-persistence');
var inherits = require('util').inherits;
module.exports = FakeSkiffPersistence;
function FakeSkiffPersistence() {
}
inherits(FakeSkiffPersistence, AbstractSkiffPersistence);
FakeSkiffPersistence.prototype._
'use strict';
module.exports = AbstractSkiffPersistence;
function AbstractSkiffPersistence(options) {
}
FakeSkiffPersistence.prototype._saveMeta = function(nodeId, state, callback) {
// ...
};
FakeSkiffPersistence.prototype._loadMeta = function(nodeId, callback) {
// ...
};
FakeSkiffPersistence.prototype._applyCommand = function(nodeId, commitIndex, command, callback) {
// ...
};
FakeSkiffPersistence.prototype._lastAppliedCommitIndex = function(nodeId, callback) {
// ...
};
FakeSkiffPersistence.prototype._saveCommitIndex = function(nodeId, commitIndex, callback) {
// ...
};
FakeSkiffPersistence.prototype._createReadStream = function(nodeId) {
// ...
};
FakeSkiffPersistence.prototype._createWriteStream = function(nodeId) {
// ...
};
FakeSkiffPersistence.prototype._removeAllState = function(nodeId, callback) {
// ...
};
FakeSkiffPersistence.prototype._close = function(callback) {
// ...
};
You can use this module to test your Skiff Persistence provider:
'use strict';
var test = require('abstract-skiff-persistence/test/all');
var FakeSkiffPersistence = require('../');
var p = new FakeSkiffPersistence();
var options = {
commands: [
{type: 'put', key: 'a', value: 1},
{type: 'put', key: 'b', value: 2},
{type: 'del', key: 'a'},
{type: 'put', key: 'c', value: {some: 'object'}}
],
expectedReads: [
{key: 'b': value: 2},
{key: 'c': value: {some: 'object'}}
},
newWrites: [
{type: 'put', key: 'd', value: 3},
{type: 'put', key: 'e', value: {some: 'other object'}},
{type: 'put', key: 'f', value: 'some other string'}
],
newReads: [
{key: 'd', value: 3},
{key: 'e', value: {some: 'other object'}},
{key: 'f', value: 'some other string'}
]
};
test(p, options);
ISC
FAQs
Abstract Skiff Persistence provider
The npm package abstract-skiff-persistence receives a total of 14 weekly downloads. As such, abstract-skiff-persistence popularity was classified as not popular.
We found that abstract-skiff-persistence demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.