node package manager

vinyl-dat

vinyl-dat NPM version

Vinyl adapter for dat

Install

Install with npm:

npm i vinyl-dat --save-dev

Usage

var dat = require('dat');
var vdat = require('vinyl-dat');
var debug = require('gulp-debug');
 
// new gulp task with callback 
gulp.task('demo', function (cb) {
 
  // new dat database instance 
  var db = dat('path/to/dat/database', function (err) {
    if (err) return cb(err);
 
    // new stream from dat 
    var stream = vdat.src(db)
      // show each record 
      .pipe(debug())
      // write changed records to same database 
      .pipe(vdat.dest(db));
 
    // use stream on end to close the database when finished 
    stream.on('end', function () {
      db.close(cb);
    });
 
  });
});

API

Author

Brian Woodward

License

Copyright (c) 2014 Brian Woodward, contributors.
Released under the MIT license


This file was generated by verb-cli on August 27, 2014.