New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

designer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

designer

A lib for managing design docs in couchDB

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Designer

Build Status

How to:

npm install designer

var designer = require('designer');
var docs = [
  {
    _id: '_design/people',
    version: 1,
    views: {
      friendly: {
        map: "function(person) { return (doc.manners > 4 && doc.empathy > 7) }"
      }
    }
  }
];
designer('http://localhost:5984/ohai', docs, function(errs) {
  errs.forEach(function(err, i) {
    console.log('err for', docs[i], 'was', err);
  });
});

What?

This is a library for managing your design docs in a couch database.

A nice thing about CouchDB is that your code is data. Configuring your database is just a matter of putting some data (design docs) in it.

The superpower this gives your applications is that your source code can include data that tells the database how the application expects it to behave.

In pseudocode:

start application
application looks on disk for some design documents
application posts all those design documents to its couch
couch now has all the views/etc that the application expects
yay!

I found myself writing the above code across multiple applications.

It gets dreary when you also have to handle making modifications to design docs. In order to update a document, you have to overwrite the old one. Obviously you only want to do this if you've got something newer!

designer expects your documents to have a version property. They get compared with if (new < old) so they should probably just be integers.

Keywords

couchdb

FAQs

Package last updated on 07 Aug 2015

Did you know?

Socket

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.

Install

Related posts