Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Masquer les espaces
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Styles de texte
Modifier l’apparence
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 10 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
23 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
53 lignes
Copier tout
16 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
48 lignes
Copier tout
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,
Copier
Copié
Copier
Copié
displayErrors = this.displayErrors,
Copier
Copié
Copier
Copié
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),
Copier
Copié
Copier
Copié
body = opts.body || querystring.stringify(post),
env = {
env = {
REQUEST_METHOD: method,
REQUEST_METHOD: method,
Copier
Copié
Copier
Copié
CONTENT_LENGTH: body.length,
QUERY_STRING: query
QUERY_STRING: query
Copier
Copié
Copier
Copié
};
},
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(
Copier
Copié
Copier
Copié
'
%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),
Copier
Copié
Copier
Copié
filePath
filePath
,
(typeof post == "string" ? util.format(" '%s'", post) : '')
);
);
Copier
Copié
Copier
Copié
child_process.exec(command,
function (error, stdout, stderr) {
child_process.exec(command,
{
env: env
},
function (error, stdout, stderr) {
if (error) {
if (error) {
Copier
Copié
Copier
Copié
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);
Copier
Copié
Copier
Copié
} else {
callback(null, null);
}
}
});
});
};
};
module.exports = engine;
module.exports = engine;
Différences enregistrées
Texte d'origine
Ouvrir un fichier
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;
Texte modifié
Ouvrir un fichier
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;
Trouver la différence