Skip to content
File bundle for VersionDB
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
.travis.yml
Gruntfile.js
LICENSE.md
README.md
index.js
package.json

README.md

VersionDB File Bundle

Used by VersionDB to read in a schema.json file.

Build Status

Usage

var filebundle = require('versiondb-bundle-file');
filebundle('path/to/schema.json', function(err, bundle) {
    // bundle conforms to bundle interface that VersionDB requires
});

File Format

A File Bundle consists of a .json file any number of corresponding .sql files. The .json file conforms to a specific schema.

The .json file is an object, where each key is the name of the product. Each value of a product is again an object, where each key is a valid semver version, and the corresponding value is a filename. The filename is relative to the .json file.

Example

In this example, we have the following files in a single directory.

schema.json
product1-1.0.0.sql
product1-1.0.1.sql
product1-1.0.2.sql
product2-1.0.0.sql
product2-2.0.0.sql

Our schema.json file might look like this:

{
    "product1": {
        "1.0.0": "product1-1.0.0.sql",
        "1.0.1": "product1-1.0.1.sql",
        "1.0.2": "product1-1.0.2.sql"
    },
    "product2": {
        "1.0.0": "product2-1.0.0.sql",
        "2.0.0": "product2-2.0.0.sql"
    }
}
Something went wrong with that request. Please try again.