
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
A simplistic and easy to scale JSON document datastore.
kval uses a mongoose-like API.
npm install -g kval
(may require elevated privileges)kval start
(required elevated privileges)
kval help
This will install the database, keep it up on server reboots. By default
it listens on 127.0.0.1:9226
.
To be accessible externally, the port will need to be opened in your firewall, and you must listen on a public IP.
The database will be installed in the kval
folder of your global node_modules.
Run npm list -g
to see where node_modules are installed.
See the config file inside the installation: db-config.json
.
Example default config file:
[{
"name": "kval",
"script": "worker.js",
"exec_mode": "cluster",
"instances": 2,
"env": {
"host": "127.0.0.1"
"port": "9226",
"path": "kval-db"
"mapSize": "268435456000",
"password": ""
},
"max_memory_restart": "320MB"
}]
(if this looks familiar, it is a pm2 process file)
var Kval = require('kval').Client;
var kval = new Kval();
kval.connect({
host: '127.0.0.1',
port: 9226,
password: 'swordfish'
}, function (err) {
if (err) {
console.error(err.message);
return;
}
console.log('Connected!');
});
var schema = {
properties: {
name: {
type: 'string'
index: true // makes it searchable, non-indexed fields are not
},
age: {
type: 'number'
},
libraryCard: {
type: 'string',
unique: true // makes it searchable and ensures uniqueness
}
}
};
var User = client.model('User4', schema);
var user = new User({ name: 'Bill', age: 32, libraryCard: 'A-55555' });
console.log(user.id); // auto generated id field
user.save(function (err, savedUser) {
if (err) {
console.error(err.message);
return;
}
console.log('User was saved', savedUser);
});
User.findById(id, callback);
User.find(id, callback);
User.findById('Yrei32kLisd9gaknbl9akNyr', function (err, user) {
if (err) { console.error(err); }
user.remove(function (err) {
if (err) { console.error(err); }
console.log('User was removed successfully.');
})
});
Drivers for other languages have not been added yet. Please open an issue if you are interested in support for a language other than Node, or if you created one and would like us to list it here.
FAQs
The thoughtless datastore. Easy to use, easy to scale.
The npm package kval receives a total of 1 weekly downloads. As such, kval popularity was classified as not popular.
We found that kval 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.