Giter Site home page Giter Site logo

grunt-couchapp's Introduction

grunt-couchapp

A grunt plugin for building and installing couchapps

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-couchapp

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-couchapp');

Documentation

You'll want to add some configuration for the plug-in. This plugin provides three tasks, mkcouchdb to create new databases, rmcouchdb to delete all data and drop an existing database, and couchapp, which installs a specified couchapp into the database.

mkcouchdb: {
    demo: {
        db: 'http://localhost:5984/grunt-couchapp-demo',
        options: {
            okay_if_exists: true
        }
    }
},

rmcouchdb: {
    demo: {
        db: 'http://localhost:5984/grunt-couchapp-demo',
        options: {
            okay_if_missing: true
        }
    }
},

couchapp: {
    demo: {
        db: 'http://localhost:5984/grunt-couchapp-demo',
        app: './demo/app.js'
    }
}

As a stylistic note, all of the commands take the same info, so it's possible to write in your configuration file:

couch_config = {
    demo: {
        db: 'http://localhost:5984/grunt-couchapp-demo',
        app: './demo/app.js',
        options: {
            okay_if_missing: true,
            okay_if_exists: true
        }
    }
}

grunt.initConfig({
    ...            
    mkcouchdb: couch_config,
    rmcouchdb: couch_config,
    couchapp: couch_config,
    ...
});    

Note that if you call rmcouchdb without a sub-argument, it will not delete any databases.

Demo

It is possible to run the entire toolchain (drop, initialize, and install) with the grunt.js file by calling grunt demo. As long as you have a local couchdb running in admin-party mode, and browse to http://localhost:5984/grunt-couchapp-demo/_design/app/index.html You should get back a happy message.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

License

Copyright (c) 2012 Ken Elf Mathieu Sternberg
Licensed under the MIT license.

grunt-couchapp's People

Contributors

chewbranca avatar drsm79 avatar elfsternberg avatar garbados avatar samhiatt avatar skiqh avatar

Watchers

 avatar  avatar

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.