Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
datasette is a key-value container for arbitrary data.
$ npm install datasette
The first thing you need to do is to integrate datasette into your application. For that add a reference to the datasette
module:
const Datasette = require('datasette');
Next, you can create a new data container:
const datasette = new Datasette();
To set data, call the data container's set
function and specify the key
and the value
you want to store:
datasette.set('foo', { bar: 'baz' });
To set multiple keys and values at once, you can also hand over an object that contains the data:
datasette.set({
foo: 23,
bar: 42
});
This is equivalent to calling set
two times with separate key value pairs.
To get data, call the data container's get
function and specify the key
you would like to retrieve:
const value = datasette.get('foo');
Note: Each time you call get
, you will get a cloned result to avoid conflicting state changes on a shared reference.
Every time a value is created, changed or deleted, the data container will emit a changed
event. Use the on
or once
functions to subscribe to this event:
datasette.on('changed', (key, value) => {
// ...
});
If you are only interested in changed
events for a specific key
, subscribe to the changed::*
event instead:
datasette.on('changed::foo', value => {
// ...
});
Note: If you set the same key value pair two times, the data container will not emit an event on the second set
call.
To unsubscribe from event notifications, use the off
function.
If you don't want a set
call to result in an emitted event, you can specify an options
object and set its silent
property to true
:
datasette.set('foo', 'bar', { silent: true });
To build this module use roboter.
$ bot
The MIT License (MIT) Copyright (c) 2013-2018 the native web.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
datasette is a key-value container for arbitrary data.
We found that datasette demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.