Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
CouchDBChanges
Advanced tools
var CouchDBChanges = require("CouchDBChanges");
var config = {
url: "http://127.0.0.1:5984/mydb",
filter: "pommes",
persistent_since: true
};
var changes = new CouchDBChanges(config, function(error, change) {
// do dat change!
});
Wow, easy!
CouchDB, The Definitive Guide has a chapter on the Changes feed.
CouchDB has this amazing feature called the “Changes Feed”. Think of
git log
for your database. There’s all sorts of awesome you can do
with this. For example, have a database called outbox
and connect
a CouchDB changes listener to it and whenever your application creates
a new document, say
{
"from": "me@example.com",
"to": "you@example.com",
"subject": "Hey there!",
"body": "I think you get the idea"
}
the changes listener then gets notified right when the document gets created, but asynchronously from your application and send the email that is described. When the email is sent, it can write back a new field
"status": "sent"
or, if anything went wrong:
"status": "error",
"error_message": "that email address is bogus you twat!"
that the application can then use again to update the user interface accordingly.
So yeah, quick example, but there’s tons of things you can do with this. We should collect nice examples, but for now you can check out https://github.com/janl/couchdb-external-CreateUserDatabase.
CouchDBChanges(config, change_cb)
config
url
: string or url-object: URL to the database. Can include
a username and password.All parameters for the follow library
All parameters for the CouchDB Changes API.
follow_options
: (object) configurations for following {
persistent_since
: (bool) false whether or not to persist the
latest seq_id
from the server. This allows us
to avoid processing a change more than once.
change_cb
: (callable) function to call for each change
persistent_since
storage configurable.This is just a very thin wrapper around Jason Smith’s / Iris Couch’s
excellent follow
library.
Thanks Jason!
(c) 2012 Jan Lehnardt jan@apache.org
Licensed under the Apache License 2.0.
FAQs
Write CouchDB Changes Handlers. Easy.
We found that CouchDBChanges 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.