external-editor
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.12.0 | ||
// Generated by CoffeeScript 1.12.6 | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.12.0 | ||
// Generated by CoffeeScript 1.12.6 | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.12.0 | ||
// Generated by CoffeeScript 1.12.6 | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.12.0 | ||
// Generated by CoffeeScript 1.12.6 | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.12.0 | ||
// Generated by CoffeeScript 1.12.6 | ||
@@ -10,3 +10,3 @@ /* | ||
(function() { | ||
var CreateFileError, ExternalEditor, FS, LaunchEditorError, ReadFileError, RemoveFileError, Spawn, SpawnSync, Temp, | ||
var CreateFileError, ExternalEditor, FS, IConvLite, JSCharDet, LaunchEditorError, ReadFileError, RemoveFileError, Spawn, SpawnSync, Temp, | ||
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | ||
@@ -22,2 +22,6 @@ | ||
JSCharDet = require('jschardet'); | ||
IConvLite = require('iconv-lite'); | ||
CreateFileError = require('./errors/CreateFileError'); | ||
@@ -31,2 +35,4 @@ | ||
JSCharDet.Constants.MINIMUM_THRESHOLD = 0; | ||
ExternalEditor = (function() { | ||
@@ -149,3 +155,5 @@ ExternalEditor.edit = function(text) { | ||
this.temp_file = Temp.tmpNameSync({}); | ||
return FS.writeFileSync(this.temp_file, this.text); | ||
return FS.writeFileSync(this.temp_file, this.text, { | ||
encoding: 'utf8' | ||
}); | ||
} catch (error) { | ||
@@ -158,5 +166,7 @@ e = error; | ||
ExternalEditor.prototype.readTemporaryFile = function() { | ||
var e; | ||
var buffer, e, encoding; | ||
try { | ||
return this.text = FS.readFileSync(this.temp_file).toString(); | ||
buffer = FS.readFileSync(this.temp_file); | ||
encoding = JSCharDet.detect(buffer); | ||
return this.text = IConvLite.decode(buffer, encoding.encoding); | ||
} catch (error) { | ||
@@ -163,0 +173,0 @@ e = error; |
{ | ||
"name": "external-editor", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT", | ||
@@ -29,2 +29,4 @@ "main": "main/index.js", | ||
"dependencies": { | ||
"iconv-lite": "^0.4.17", | ||
"jschardet": "^1.4.2", | ||
"tmp": "^0.0.31" | ||
@@ -31,0 +33,0 @@ }, |
@@ -10,3 +10,3 @@ # External Editor | ||
Version: 2.0.3 | ||
Version: 2.0.1 | ||
@@ -13,0 +13,0 @@ As of version 2.0.0, node 0.10 is no longer support. Minimum node version is now 0.12. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19717
325
3
+ Addediconv-lite@^0.4.17
+ Addedjschardet@^1.4.2
+ Addediconv-lite@0.4.24(transitive)
+ Addedjschardet@1.6.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)