Giter VIP home page Giter VIP logo

node-couch-database-spawner's Introduction

node-couch-database-spawner

CouchDb database spawner for Node.Js using node-couch

Installation

npm install node-couch-database-spawner --save

NPM package

Usage

var spawner = require('node-couch-database-spawner'),
        options = {
            databasesPath: './databases/',
            nodeCouch: { // node-couch options
               credentials: {
                   userName: 'user',
                   password: 'pass'
               },
               url: {
                   hostName: 'localhost',
                   port: 5984
               }
           }
        };

spawner.spawn(options);

File/Folder structure

node-couch-database-spawner reads a local file/folder structure to build up database definitions to be spawned. Inside the options.databasesPath it is expected that the file/folder structure is as follows:

  • [DatabaseName]: Folder - Can be chosen.
    • designs: Folder - Name must be designs.
      • [AnyNameDesignDocument].js: File - Design document specification (Node.Js JavaScript format). File name is irrelevant.
      • ... - Any amount.
    • documents: Folder - Name must be documents.
      • [DocumentType]: Folder - Containing documents divided by type. Each document under the folder will be augmented with a type property having the value of the folder name.
        • [AnyNameDocument].json: File - Document specification (JSON format). File name is irrelevant.
        • ... - Any amount.
      • ... - Any amount.

Api

Methods

.spawn(options)

(Re)Spawns CouchDb databases using the folder/files defined under options.databasesPath.

Options

.databasesPath

String. Optional. Path to folder containing databases to be spawned, relative to current working directory. Defaults to: ./databases/.

.nodeCouch

Object. Required. See node-couch initialization data.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Release History

  • 2019-02-08 v1.2.0 Fix for spawning partial databases.
  • 2017-10-26 v1.1.0 Fix for spawning multiple databases.
  • 2017-09-22 v1.0.0 Initial version.

node-couch-database-spawner's People

Contributors

hyddan 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.