Comparing version 1.1.3 to 1.1.4
@@ -18,6 +18,7 @@ #!/usr/bin/env node | ||
/* eslint no-console: 0 */ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var async = require('async'); | ||
var chalk = require('chalk'); | ||
var argv = require('yargs') | ||
@@ -32,7 +33,7 @@ .alias('o', 'output') | ||
var path = require('path'); | ||
// var path = require('path'); | ||
var esmall = require('../'); | ||
var {success, error} = require('./logger'); | ||
var outputFile | ||
if (argv._.length === 0) { | ||
@@ -45,3 +46,3 @@ error('You must provide an input file!'); | ||
try { | ||
var resolved = path.resolve(argv._[0]); | ||
var resolved = path.resolve(pathName); | ||
} | ||
@@ -57,3 +58,3 @@ catch (err) { | ||
if (err) { | ||
error('Reading the file failed', err) | ||
error('Reading the file failed', err); | ||
} | ||
@@ -68,3 +69,3 @@ esmall(data.toString(), handleMinified); | ||
} | ||
fs.writeFile(resolve(argv.o), minified, cleanup) | ||
fs.writeFile(resolve(argv.o), minified, cleanup); | ||
} | ||
@@ -75,5 +76,6 @@ | ||
error('Writing to file failed', err); | ||
proces.exit(1); | ||
process.exit(1); | ||
} | ||
success('It worked 🎉'); | ||
process.exit(0); | ||
} | ||
@@ -83,3 +85,3 @@ | ||
if (err) { | ||
if (err.code === "ENOENT") { | ||
if (err.code === 'ENOENT') { | ||
error(`${argv._[0]} does not exist`); | ||
@@ -86,0 +88,0 @@ process.exit(1); |
@@ -16,2 +16,4 @@ /* Copyright 2016 Myles Borins | ||
/* eslint no-console: 0 */ | ||
var chalk = require('chalk'); | ||
@@ -18,0 +20,0 @@ |
@@ -22,3 +22,3 @@ /* Copyright 2016 Myles Borins | ||
return !((code === '') || (code === ' ')); | ||
}; | ||
} | ||
@@ -33,8 +33,11 @@ function minify(code, cb) { | ||
code = code.replace(/(\/\*([\s\S]*?)\*\/)|(\/\/(.*)$)/gm, ''); | ||
code = code.split('\n'); | ||
code = code.filter(isNotEmpty); | ||
// remove whitespace at the begining and end of each line | ||
code = code.map(reggae); | ||
code = code.join(' '); | ||
// remove any spaces after a semi colon | ||
@@ -41,0 +44,0 @@ code = code.replace(/;\s+/g, ';'); |
{ | ||
"name": "esmall", | ||
"version": "1.1.3", | ||
"description": "Lol... I just wrap babili", | ||
"version": "1.1.4", | ||
"description": "Pretty Naive", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "tap test/" | ||
"test": "npm run lint && npm run tap", | ||
"tap": "tap test/", | ||
"lint": "eslint index.js bin/ test/" | ||
}, | ||
@@ -14,4 +16,2 @@ "bin": "bin/esmall.js", | ||
"dependencies": { | ||
"async": "^2.1.4", | ||
"babili": "0.0.9", | ||
"chalk": "^1.1.3", | ||
@@ -21,2 +21,3 @@ "yargs": "^6.5.0" | ||
"devDependencies": { | ||
"eslint": "^3.12.2", | ||
"tap": "^8.0.1" | ||
@@ -23,0 +24,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93841
2
11
214
2
- Removedasync@^2.1.4
- Removedbabili@0.0.9
- Removedanymatch@1.3.2(transitive)
- Removedarr-diff@2.0.04.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-unique@0.2.10.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedasync@2.6.4(transitive)
- Removedasync-each@1.0.6(transitive)
- Removedatob@2.1.2(transitive)
- Removedbabel-cli@6.26.0(transitive)
- Removedbabel-code-frame@6.26.0(transitive)
- Removedbabel-core@6.26.3(transitive)
- Removedbabel-generator@6.26.1(transitive)
- Removedbabel-helper-flip-expressions@0.0.1(transitive)
- Removedbabel-helper-is-nodes-equiv@0.0.1(transitive)
- Removedbabel-helper-is-void-0@0.0.1(transitive)
- Removedbabel-helper-mark-eval-scopes@0.1.1(transitive)
- Removedbabel-helper-remove-or-void@0.1.1(transitive)
- Removedbabel-helper-to-multiple-sequence-expressions@0.0.2(transitive)
- Removedbabel-helpers@6.24.1(transitive)
- Removedbabel-messages@6.23.0(transitive)
- Removedbabel-plugin-minify-constant-folding@0.0.1(transitive)
- Removedbabel-plugin-minify-dead-code-elimination@0.1.7(transitive)
- Removedbabel-plugin-minify-flip-comparisons@0.0.1(transitive)
- Removedbabel-plugin-minify-guarded-expressions@0.0.3(transitive)
- Removedbabel-plugin-minify-infinity@0.0.1(transitive)
- Removedbabel-plugin-minify-mangle-names@0.0.4(transitive)
- Removedbabel-plugin-minify-numeric-literals@0.0.1(transitive)
- Removedbabel-plugin-minify-replace@0.0.1(transitive)
- Removedbabel-plugin-minify-simplify@0.0.4(transitive)
- Removedbabel-plugin-minify-type-constructors@0.0.2(transitive)
- Removedbabel-plugin-transform-member-expression-literals@6.9.4(transitive)
- Removedbabel-plugin-transform-merge-sibling-variables@6.9.5(transitive)
- Removedbabel-plugin-transform-minify-booleans@6.9.4(transitive)
- Removedbabel-plugin-transform-property-literals@6.9.4(transitive)
- Removedbabel-plugin-transform-regexp-constructors@0.0.1(transitive)
- Removedbabel-plugin-transform-simplify-comparison-operators@6.9.4(transitive)
- Removedbabel-plugin-transform-undefined-to-void@6.9.4(transitive)
- Removedbabel-polyfill@6.26.0(transitive)
- Removedbabel-preset-babili@0.0.8(transitive)
- Removedbabel-register@6.26.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbabel-template@6.26.0(transitive)
- Removedbabel-traverse@6.26.0(transitive)
- Removedbabel-types@6.26.0(transitive)
- Removedbabili@0.0.9(transitive)
- Removedbabylon@6.18.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbinary-extensions@1.13.1(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@1.8.52.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedchokidar@1.7.0(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddetect-indent@4.0.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedexpand-brackets@0.1.52.1.4(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@0.3.22.0.4(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.44.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfs-readdir-recursive@1.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@1.2.13(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.0(transitive)
- Removedglobals@9.18.0(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhome-or-tmp@2.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedinvariant@2.2.4(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-binary-path@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-extglob@1.0.0(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-glob@2.0.1(transitive)
- Removedis-number@2.1.03.0.04.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedjs-tokens@3.0.2(transitive)
- Removedjsesc@1.3.0(transitive)
- Removedjson5@0.5.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash.some@4.6.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmicromatch@2.3.113.1.10(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedms@2.0.0(transitive)
- Removednan@2.22.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedoutput-file-sync@1.1.2(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedprivate@0.1.8(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedreaddirp@2.2.1(transitive)
- Removedregenerator-runtime@0.10.50.11.1(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedslash@1.0.0(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-support@0.4.18(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedto-fast-properties@1.0.3(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedtrim-right@1.0.1(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removeduser-home@1.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedv8flags@2.1.1(transitive)
- Removedwrappy@1.0.2(transitive)