New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

istatic

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

istatic - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

36

lib/read.js

@@ -65,33 +65,39 @@ var fs = require('fs');

var charset = opt.charset || 'utf-8';
var debug = process.env.DEBUG || opt.debug;
var doCompress = 'compress' in opt ? opt.compress : true;
var doCache = opt.fresh ? false : doCache;
var _doCache = opt.fresh ? false : doCache;
var str = doCache ? (cache[filepath] || global_cache[filepath]) : '';
var str = _doCache ? (cache[filepath] || global_cache[filepath]) : '';
if (str && doCache) return str;
if (str && _doCache) return str;
str = fs.readFileSync(filepath, charset);
try {
str = fs.readFileSync(filepath, charset);
} catch (e) {
console.error('[istatic] Reading..', filepath, e);
}
switch (filetype) {
case 'js':
str = _uglify('js', str, opt.js, doCompress);
break;
case 'styl':
filetype = 'css';
stylus.render(str, function(err, str) {
if (!err) cache[filepath] = _uglify('css', str, opt.css, doCompress);
if (err) console.error('[istatic] Compiling', filepath, err);
else cache[filepath] = _uglify('css', str, opt.css, doCompress);
});
case 'less':
filetype = 'css';
less.render(str, function(err, str) {
if (!err) cache[filepath] = _uglify('css', str, opt.css, doCompress);
if (err) console.error('[istatic] Compiling', filepath, err);
else cache[filepath] = _uglify('css', str, opt.css, doCompress);
});
// better simple than none
// once the render is done, we can safely return good css
break;
case 'css':
str = _uglify('css', str, opt.css, doCompress);
//case 'js':
//case 'css':
default:
// return the original str
if (filetype == 'css' || filetype == 'js')
str = _uglify(filetype, str, opt[filetype], doCompress);
}
if (opt.showPath) str = '\n/* == istatic: ' + filepath + ' == */\n' + str;
if (doCache) cache[filepath] = global_cache[filepath] = str;
if (debug) str = '\n/* == istatic: ' + filepath + ' == */\n' + str;
if (_doCache) cache[filepath] = global_cache[filepath] = str;
return str;

@@ -98,0 +104,0 @@ };

{
"name": "istatic",
"version": "0.0.6",
"version": "0.0.7",
"homepage": "http://github.com/ktmud/express-istatic",

@@ -5,0 +5,0 @@ "description": "Add compressed inline css and scripts to your html, but write them as seperated files.",

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