Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
隱藏空白變更
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
文字樣式
變更外觀
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
10 年前
差異永不過期
清除
匯出
分享
解釋
23 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
53 行
全部複製
16 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
48 行
全部複製
var path = require('path'),
var path = require('path'),
util = require('util'),
util = require('util'),
querystring = require('querystring'),
querystring = require('querystring'),
child_process = require('child_process');
child_process = require('child_process');
var engine = function (filePath, opts, callback) {
var engine = function (filePath, opts, callback) {
var binPath = this.binPath,
var binPath = this.binPath,
runnerPath = this.runnerPath,
runnerPath = this.runnerPath,
複製
已複製
複製
已複製
displayErrors = this.displayErrors,
複製
已複製
複製
已複製
method = opts.method || 'GET',
method = opts.method || 'GET',
get = opts.get || {},
get = opts.get || {},
post = opts.post || {},
post = opts.post || {},
query = opts.query || querystring.stringify(get),
query = opts.query || querystring.stringify(get),
複製
已複製
複製
已複製
body = opts.body || querystring.stringify(post),
env = {
env = {
REQUEST_METHOD: method,
REQUEST_METHOD: method,
複製
已複製
複製
已複製
CONTENT_LENGTH: body.length,
QUERY_STRING: query
QUERY_STRING: query
複製
已複製
複製
已複製
};
},
encodedEnv = [];
for (var key in env) {
if (env[key]) {
encodedEnv.push(util.format('%s="%s"', key, env[key]));
}
}
var command = util.format(
var command = util.format(
複製
已複製
複製
已複製
'
%s %s %s %s',
'
%s
%s %s %s %s',
(body
?
util.format('echo "%s" | ', body)
: ''
) +
binPath,
encodedEnv.length
?
'export ' + encodedEnv.join(' ') + ';'
: ''
,
binPath,
runnerPath,
runnerPath,
path.dirname(filePath),
path.dirname(filePath),
複製
已複製
複製
已複製
filePath
filePath
,
(typeof post == "string" ? util.format(" '%s'", post) : '')
);
);
複製
已複製
複製
已複製
child_process.exec(command,
function (error, stdout, stderr) {
child_process.exec(command,
{
env: env
},
function (error, stdout, stderr) {
if (error) {
if (error) {
複製
已複製
複製
已複製
callback(error);
// can leak server configuration
if (displayErrors && stdout) {
callback(stdout);
} else {
callback(error);
}
} else if (stdout) {
} else if (stdout) {
callback(null, stdout);
callback(null, stdout);
} else if (stderr) {
} else if (stderr) {
callback(stderr);
callback(stderr);
複製
已複製
複製
已複製
} else {
callback(null, null);
}
}
});
});
};
};
module.exports = engine;
module.exports = engine;
已保存差異
原始文本
開啟檔案
var path = require('path'), util = require('util'), querystring = require('querystring'), child_process = require('child_process'); var engine = function (filePath, opts, callback) { var binPath = this.binPath, runnerPath = this.runnerPath, displayErrors = this.displayErrors, method = opts.method || 'GET', get = opts.get || {}, post = opts.post || {}, query = opts.query || querystring.stringify(get), body = opts.body || querystring.stringify(post), env = { REQUEST_METHOD: method, CONTENT_LENGTH: body.length, QUERY_STRING: query }; var command = util.format( '%s %s %s %s', (body ? util.format('echo "%s" | ', body) : '') + binPath, runnerPath, path.dirname(filePath), filePath ); child_process.exec(command,{ env: env }, function (error, stdout, stderr) { if (error) { // can leak server configuration if (displayErrors && stdout) { callback(stdout); } else { callback(error); } } else if (stdout) { callback(null, stdout); } else if (stderr) { callback(stderr); } else { callback(null, null); } }); }; module.exports = engine;
更改後文本
開啟檔案
var path = require('path'), util = require('util'), querystring = require('querystring'), child_process = require('child_process'); var engine = function (filePath, opts, callback) { var binPath = this.binPath, runnerPath = this.runnerPath, method = opts.method || 'GET', get = opts.get || {}, post = opts.post || {}, query = opts.query || querystring.stringify(get), env = { REQUEST_METHOD: method, QUERY_STRING: query }, encodedEnv = []; for (var key in env) { if (env[key]) { encodedEnv.push(util.format('%s="%s"', key, env[key])); } } var command = util.format( '%s %s %s %s %s', encodedEnv.length ? 'export ' + encodedEnv.join(' ') + ';' : '', binPath, runnerPath, path.dirname(filePath), filePath, (typeof post == "string" ? util.format(" '%s'", post) : '') ); child_process.exec(command, function (error, stdout, stderr) { if (error) { callback(error); } else if (stdout) { callback(null, stdout); } else if (stderr) { callback(stderr); } }); }; module.exports = engine;
尋找差異