1 | var cleaner = require('./index.js'),
|
2 | fs = require('fs'),
|
3 | file = process.argv[2];
|
4 |
|
5 | if (!file) {
|
6 | throw 'no file specified\n';
|
7 | }
|
8 |
|
9 | fs.readFile(file, 'utf-8', function (err, data) {
|
10 | if (err) {
|
11 | throw err;
|
12 | }
|
13 |
|
14 | cleaner.clean(data, function (html) {
|
15 | console.log(html);
|
16 | });
|
17 | });
|