diff --git a/README.md b/README.md index 3ae6ca5..fb2a133 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,25 @@ Utilities and [tilelive][1] integration for the [MBTiles][2] format. npm install mbtiles +### Commandline tools + +Several commandline tools are included in `bin` for manipulating existing +MBTiles files. + + mbcheck [FILE] + Check an mbtiles for missing metadata and tiles. + + mbcompact [FILE] + Eliminate duplicate images to reduce mbtiles filesize. + + mbpipe [COMMAND] [FILE] + Pipe each tile to stdin of the specified command and + write stdout into the mbtiles file. + + mbrekey [FILE] + Rekey a compacted mbtiles to save space. + + ### tilelive.js integration Example of using `tilelive` to serve tiles from an `mbtiles` file. diff --git a/bin/mbcheck b/bin/mbcheck index 67b3209..75e9cec 100755 --- a/bin/mbcheck +++ b/bin/mbcheck @@ -10,10 +10,10 @@ var options = argv = require('optimist').argv, // Show help. if (argv.help || argv._.length === 0) { - console.warn('Usage: mbcheck [OPTIONS] [FILE]'); - utils.table([ - ['--help', 'Show help.'] - ]); + console.warn('Usage: mbcheck [FILE]'); + console.warn(' Check an mbtiles for missing metadata and tiles.'); + console.warn('Examples:'); + console.warn(' mbcheck world.mbtiles'); process.exit(); } diff --git a/bin/mbcompact b/bin/mbcompact index 5ce64b1..08d8278 100755 --- a/bin/mbcompact +++ b/bin/mbcompact @@ -15,8 +15,10 @@ var options = argv = require('optimist').argv, // Show help. if (argv.help || argv._.length < 1) { - console.log('Usage: mbcompact [FILE]'); - utils.table([['--help', 'Show help.']]); + console.warn('Usage: mbcompact [FILE]'); + console.warn(' Eliminate duplicate images to reduce mbtiles filesize.'); + console.warn('Examples:'); + console.warn(' mbcompact world.mbtiles'); process.exit(); } diff --git a/bin/mbpipe b/bin/mbpipe index 7a0586c..2ae0497 100755 --- a/bin/mbpipe +++ b/bin/mbpipe @@ -17,9 +17,10 @@ var options = argv = require('optimist').argv, // Show help. if (argv.help || argv._.length < 2) { console.warn('Usage: mbpipe [COMMAND] [FILE]'); - utils.table([ - ['--help', 'Show help.'] - ]); + console.warn(' Pipe each tile to stdin of the specified command and'); + console.warn(' write stdout into the mbtiles file.'); + console.warn('Examples:'); + console.warn(' mbpipe "pngquant 32" world.mbtiles'); process.exit(); } diff --git a/bin/mbrekey b/bin/mbrekey index ffe7fe1..918ddce 100755 --- a/bin/mbrekey +++ b/bin/mbrekey @@ -7,8 +7,10 @@ var utils = require('..').utils; // Show help. if (argv.help || argv._.length < 1) { - console.log('Usage: mbrekey [FILE]'); - utils.table([['--help', 'Show help.']]); + console.warn('Usage: mbrekey [FILE]'); + console.warn(' Rekey a compacted mbtiles to save space.'); + console.warn('Examples:'); + console.warn(' mbrekey world.mbtiles'); process.exit(); } diff --git a/package.json b/package.json index b46807c..b3bd3a7 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,12 @@ "keywords": ["map", "mbtiles"], "licenses": [{ "type": "BSD" }], "main": "./index", + "bin": { + "mbcheck": "./bin/mbcheck", + "mbcompact": "./bin/mbcompact", + "mbpipe": "./bin/mbpipe", + "mbrekey": "./bin/mbrekey" + }, "repositories": [{ "type": "git", "url": "http://github.com/mapbox/node-mbtiles.git"