
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
So, Basho does not have an official javascript interface to Riak. However, there is this riak-js thing. I found it to be poorly documented, and the interface was not suitable for very small programs (I write command-line tools, rather than web-front-end-ish type things). I wanted something synchronous, something simple, that wouldn't take up too much space in my code.
Accordingly, I wrote a tiny little wrapper around http
, and here is the product.
It is my hope that the code behind this never actually exceeds the length of the
documentation & test suite, and that anyone should be able to just
npm install riak-dc
and be coding against a Riak quickly.
Riak.init( hostname, port, proxy )
hostname
, and port
, which are what you would
expect them to be. Note that this call is optional, and defaults are localhost
and 8098
, respectively. If you wish to use an http proxy, you may pass an
object that looks like { host: 'localhost', port: '3128' }
and riak-dc
will attempt to use this proxy for all calls. You may also set the
environment variables HTTP_PROXY_HOST
and HTTP_PROXY_PORT
. Using init()
will override any environment variables you may have set.Riak.ping()
Riak.get_keys( bucket )
[]
, which is what get_keys
will return to you here.Riak.get_tuple( bucket, key )
JSON.parse(tuple)
), as it can be anything.
In the event that Riak has stored a 0-byte tuple: (that is, the bucket/key pair
are valid, the HTTP request returns 200, but the record is empty), you will
receive an Error. This is not strictly an error condition, but it is helpful to
know that the request itself was at least successful (whereas returning nothing
is not helpful).Riak.get_buckets( )
Riak.put_tuple( bucket, tuple, key )
key
argument is optional. If you supply
a key, that will be provided as Riak for the tuple you have asked to store.
User-supplied keys are useful for key filters,
if hierarchically-named keys is something you want.
If you have omitted a key for storing the tuple, you will be returned a promise
for the key that Riak has provided.Riak.del_tuple( bucket, key )
FAQs
A very, very tiny interface to Riak
The npm package riak-dc receives a total of 4,388 weekly downloads. As such, riak-dc popularity was classified as popular.
We found that riak-dc 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.