Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esmall

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esmall - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

.eslintrc

22

bin/esmall.js

@@ -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 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc