Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
= NAME
couch_docs - Manage CouchDB views and documents from the filesystem.
Author: Chris Strom
http://github.com/eee-c/couch_docs
(formerly couch_design_docs)
= DESCRIPTION
I have two primary use cases: uploading fixture data for integration testing and editing CouchDB documents in my favorite editor. It could also be useful as a cheap back-up mechanism, though it likely would not work well with large datasets (see PROBLEMS/FUTURE).
== Fixture Strategy
Before an integration test, I create a new CouchDB database with a randomly generated name. I use couch_docs to upload fixture data to that database:
CouchDocs.put_dir(DB_URL, DIRECTORY)
Then, I allow the test run to proceed normally. At the end of the run, I teardown the test database.
Since CouchDB database creation / destruction is so cheap, this allows for quite fast integration tests -- even including necessary design documents.
== Editing with Emacs
I much prefer editing JSON documents in Emacs (lesser editors should work) over using the Futon web interface built into CouchDB. To initiate this, I watch the directory containing the JSON document(s):
couch-docs push -w localhost:5984/db
The -w option uses directory watcher to watch for any changes on the file system. When a change occurs, the updated document is loaded to CouchDB immediately. This is very useful for rapid editing/prototyping of documents that are subsequently used in another medium (e.g. for a blog post).
= FEATURES
Upload JSON documents stored on the filesystem into a CouchDB database.
Map .js files stored on the filesystem (e.g. _design/recipes/count_by_month/map.js) into CouchDB design documents.
Dump documents stored in CouchDB to the filesystem.
Attachments are stored as real files (not inline, mime64 encoded attributes on the JSON document)
De-resolution of !code macros.
Command line script (couch-docs) to push / dump CouchDB database.
= SYNOPSIS
From the command line:
couch-docs dump http://localhost:5984/db
couch-docs push http://localhost:5984/db
In code:
DB_URL = "http://localhost:5984/db" DIRECTORY = "/repos/db/couchdb/"
CouchDocs.put_dir(DB_URL, DIRECTORY)
CouchDocs.dump(DB_URL, "/repos/db/bak")
= REQUIREMENTS
= INSTALL
= PROBLEMS/FUTURE
Does not honor CouchDB document revisions. Instead it deletes previous revisions and uploads an entirely new one.
A progress bar would be helpful.
Unit testing of view javascript would be very nice.
Will almost certainly not work for large datasets (>10k documents).
= LICENSE
(The MIT License)
Copyright (c) 2010
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
Unknown package
We found that couch_docs 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.