bin.js 289 B

12345678910111213
  1. #! /usr/bin/env node
  2. var lzString = require('../libs/lz-string.js');
  3. var fs = require('fs');
  4. if (process.argv.length < 3) {
  5. console.error('Usage: lz-string <input_file>');
  6. process.exit(1);
  7. }
  8. console.log(lzString.compress(fs.readFileSync(process.argv[2], {
  9. encoding: 'utf8',
  10. })));