Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
couch-compile
Advanced tools
Readme
Build CouchDB documents from directory, JSON or module.
var compile = require('couch-compile');
compile('/my/couch/app', function(err, doc) {
// push
});
compile(directory, [options], callback)
Options
When options.multipart
is true, attachments are handled as multipart.
callback
callback
is called with two arguments: error
and doc
.
In case options.multipart
is set, callback
is called with a third argument:
attachments
. This is a multipart attachments array as required by
nanos
db.multipart.insert
:
{
name: 'rabbit.png',
content_type: 'image/png',
data: <Buffer>
}
data
can be a Buffer
or a String
.
A simple commandline client is included:
npm install -g couch-compile
Give it a directory, or use the current one:
couch-compile /my/couch/app
couch-compile
uses a filesystem mapping similar to Couchapp python
tool and
Erika:
The Couchapp Filesystem
Mapping.
It is quite self-explanatory. For example:
myapp
├── _id
├── language
└── views
└── numbers
├── map.js
└── reduce.js
becomes:
{
"_id": "_design/myapp",
"language": "javascript",
"views": {
"numbers": {
"map": "function...",
"reduce": "function..."
}
}
}
See test/fixtures
and test/expected
for usage examples.
For property names file extensions will be stripped:
{
"validate_doc_update": "content of validate_doc_update.js",
}
Files inside the \_attachments
directory are handled special:
They become attachment entries of the form
{
"a/file.txt": {
"data": "SGVsbG8gV29ybGQhCg==",
"content_type": "text/plain"
}
}
The content\_type
is computed using mime.
data
is the base64 encoded value of the file.
Read more about Inline Attachments.
Run the testsuite with
npm test
(c) 2014 Johannes J. Schmidt, TF
MIT License
FAQs
Build CouchDB documents from fs.
The npm package couch-compile receives a total of 14 weekly downloads. As such, couch-compile popularity was classified as not popular.
We found that couch-compile 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.