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

flex-combo

Package Overview
Dependencies
Maintainers
2
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flex-combo - npm Package Compare versions

Comparing version 0.4.7 to 0.4.8

26

flex-combo.js

@@ -11,5 +11,5 @@ var http = require('http')

, util = require('util')
, mime = require('mime');
, mime = require('mime')
, juicer = require('juicer');
var debug = require('debug')('flex-combo:debug');

@@ -151,3 +151,2 @@ var debugInfo = require('debug')('flex-combo:info');

}
if(fs.existsSync(absPath)){

@@ -169,2 +168,23 @@ var buff = fs.readFileSync(absPath);

}
//前后端模板一致化,如果是*.html.js格式的请求,并且js文件不存在,则编译*.html为juicer的function格式返回
var extName = path.extname(absPath);
var htmlName = absPath.slice(0, absPath.length - extName.length);
if(path.extname(htmlName).toLowerCase() === '.html' ){
var buff = fs.readFileSync(htmlName);
var charset = isUtf8(buff) ? 'utf8' : 'gbk';
var tpl = iconv.decode(buff, charset);
var compiled = juicer(tpl)._render;
//允许为某个url特别指定编码
var outputCharset = param.charset;
if(param.urlBasedCharset && param.urlBasedCharset[longestMatchPos]){
outputCharset = param.urlBasedCharset[longestMatchPos];
}
var tempalteFunction = 'window["'+revPath+'"] = ' + compiled.toString();
cosoleResp('Local Juicer Compile', htmlName);
return iconv.encode(tempalteFunction, outputCharset);
}
}

@@ -171,0 +191,0 @@ return null;

5

package.json
{
"name": "flex-combo",
"version": "0.4.7",
"version": "0.4.8",
"description": "The Flex-combo is combo tool designed for web front-end developer. It support various kinds of combo format by modify configuration(eg. yahoo combo).",

@@ -18,3 +18,4 @@ "main": "flex-combo.js",

"mime":"1.2.7",
"debug":"0.7.0"
"debug":"0.7.0",
"juicer":"0.6.5"
},

@@ -21,0 +22,0 @@ "devDependencies": {},

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