UNPKG

502 BJavaScriptView Raw
1#!/usr/bin/env node
2
3var base = require('./base.js');
4
5/*
6 Example showing basic matching.
7
8 Note that opts.match can also be a function
9 or a buffer if the database uses buffer paths.
10*/
11
12base(function(err, db, tree, cb) {
13 if(err) return cb(err);
14
15 tree.children(null, {
16 match: 'ba',
17 matchAncestors: true // switch to false to not include ancestors of match
18 }, function(err, children) {
19 if(err) return cb(err);
20
21 console.log("matches:", children);
22
23 cb();
24 });
25})
26