Giter VIP home page Giter VIP logo

couchdb-push's Introduction

jo

jo logo

This is jo, a small utility to create JSON objects

$ jo -p name=jo n=17 parser=false
{
    "name": "jo",
    "n": 17,
    "parser": false
}

or arrays

$ seq 1 10 | jo -a
[1,2,3,4,5,6,7,8,9,10]

It has a manual, and you can read why I wrote jo.

Build from Release tarball

To build from a release you will need a C compiler to install from a source tarball which you download from the Releases page.

tar xvzf jo-1.3.tar.gz
cd jo-1.3
autoreconf -i
./configure
make check
make install

Build from Github

Build Status

To install from the repository, you will need a C compiler as well as a relatively recent version of automake and autoconf.

git clone git://github.com/jpmens/jo.git
cd jo
autoreconf -i
./configure
make check
make install

Install

Homebrew

brew install jo

Ubuntu

apt-get install jo

Gentoo

emerge jo

Snap

Thanks to Roger Light, jo is available as a snap package. Use snap install jo from a Linux distro that supports snaps.

Windows

scoop install jo

Others

See also

Credits

couchdb-push's People

Contributors

dependabot[bot] avatar greenkeeperio-bot avatar jo avatar millette avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

couchdb-push's Issues

support handling json on the api

Currently the api for couchdb-push requires a path to a couchapp directory or json. In my use case I already have the json in the app logic and do not want to create a temporary file from it.

Supported node version

Currently, travis is testing node 0.10, 0.12, iojs, etc.

And we're not testing anything beyond node 4.0 but 6.0 is LTS now.

Beginner issue

Hi,

I like to use your module for my ember-cli-deploy-couchdb and it works on my localhost but I have some async issue. In

https://github.com/broerse/ember-cli-deploy-couchdb/blob/master/index.js

the couchapp is never upload to cloudant because the deploy does not wait for the push. The this.log is never printed. On localhost it is faster and than it works.

How do I wait? I am new to nodejs so I hope you can give me some pointers.

Unable to use couchdb-push with basic authentication url's

Whenever I use couchdb-push for a url with basic auth , I get an ENOENT error

$>> couchdb-push http://admin:password@localhost:5984/pop --index

    { [Error: ENOENT, stat '/home/deepster/POP/couchdb/http:/admin:password@localhost:5984/pop']
      errno: 34,
      code: 'ENOENT',
      path: '/home/deepster/POP/couchdb/http:/admin:password@localhost:5984/pop' }

When I use couchdb-push on a fresh couchdb installation, without any admins setup, It works fine

more of an help request really...

I am trying to use this through the command line on Windows. Is that possible ? If yes, what is the install procedure ?

Thank you for your help.

Rename Repository

to be consisten across the other projects this should be called couchdb-push

Handle replication documents

replication documents also (like user docs) have some fields updated by couchdb. These fields should be considered when diffing.

Handle database names with `/` in them

Right now, if I give couchdb-push an URL like http://localhost:5984/mail/bigbluehat-com/byoung it throws the following error:

...\node_modules\couchdb-push\node_modules\couchdb-ensure\index.js:12
  couch.request({
        ^
TypeError: undefined is not a function

If I escape them, however, things work as they should: http://localhost:5984/mail%2Fbigbluehat-com%2Fbyoung

Obviously the escaped version is what CouchDB actually wants, but it'd be nice for the developer to not have to care that much--or go figure out what's needed from that error.

Having this as part of the library would save a bunch of URL parsing boilerplate in other people's code too, fwiw.

Thanks!

Support for CommonJS within Couchdb - what am I missing?

I'd like to use couchdb's internal support for CommonJS modules. I'd think I'd be able to create my design document like this:

module.exports = {
  _id: "_design/app",
  language: "javascript",
  views: {
    lib: {
      requireField: function(doc, fieldName){
         if (!doc.hasOwnProperty(fieldName)){
           throw({forbidden: "missing field: " + fieldName});
         }
      }
    }
  },
  validate_doc_update: function(newDoc, oldDoc, userCtx){
    var requireField = require("views/lib/requireField");
    requireField(newDoc);
  }
};

When couch-push compiles my commonjs code, it converts the requireField function to a string as expected for a view, but in this case, we'd need a module.exports = prepended to that string, so that requireField actually exports something.

I don't see an obvious way to make this work without a pull request, but I figured I'd ask before I start thinking about a potential solution.

Calculate the _id from folder names if `_id` file is missing

First, thanks for building this! ๐Ÿ˜„

Second, it'd be great to mimic the couchapp.py behavior (and erica also, iirc), such the doc._id can be calculated out of the current file or directory name--if it's missing in the JSON or as an _id file.

Without that, there's a migration process needed when moving between CouchApp tools--which would be great to avoid.

Thanks again!

Idea: Merge Hook

CouchDB Push always overwrites existing files. We maybe need to support a hook, which can be supported as an option when using the API and will handle a merge:

{
  merge: function(newDoc, oldDoc) {
    newDoc.something = oldDoc.something
    return newDoc
  }
}

Support _bulk_docs format support

Sometimes its more convenient to group documents as one JSON file in bulk docs format, e.g.:

{
  "docs": [
    {
      "_id": "london",
      "name": "London"
    },
    {
      "_id": "berlin",
      "name": "Berlin"
    }
  ]
}

Currently couchdb-{compile,push} operate at a per-document level, which can become unwieldy in some scenarios, for example DB seeding.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.