diff --git a/bin/index.js b/bin/index.js index 46e3ad4..abbf3a8 100755 --- a/bin/index.js +++ b/bin/index.js @@ -1,5 +1,7 @@ #!/usr/bin/env nodejs +'use strict' + var compactor = require('../compactor.js'); var options = require('../options.js'); @@ -29,7 +31,7 @@ if (process.argv.length > 2) { } if (target) { - compactor(target, function(error, result) { + compactor(target, options, function(error, result) { console.log(result) }) } else { diff --git a/compactor.js b/compactor.js index e57379e..76d6c56 100755 --- a/compactor.js +++ b/compactor.js @@ -1,5 +1,3 @@ -#!/usr/bin/env node - 'use strict' var path = require('path') @@ -26,7 +24,11 @@ var modules = [ require('./modules/anchors.js').parser, ] -function monolith (targetDocumentPath, callback) { +function monolith (targetDocumentPath, _options, callback) { + // In case monolith got included as a library + for (var k in _options) + options[k] = _options[k] + // Determine the absolute initial document path var absBasePath = isURL(targetDocumentPath) ? absoluteURLPath(targetDocumentPath) diff --git a/package.json b/package.json index 572e2f6..e222d00 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "monolith", "version": "0.4.5", "description": "Save HTML pages with ease", - "main": "index.js", + "main": "compactor.js", "dependencies": { "sync-request": "^3.0.1", "jsdom": "^9.9.1" @@ -14,7 +14,11 @@ "test": "bin/index.js https://github.com > github.html" }, "keywords": [ - "html5", + "hoarding", + "save-the-internet", + "procrastination", + "its-mine", + "no-more-404", "monolith", "one-for-all", "all-for-one"