114 lines
9.1 KiB
JSON
114 lines
9.1 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "external-editor@^2.0.4",
|
||
|
"scope": null,
|
||
|
"escapedName": "external-editor",
|
||
|
"name": "external-editor",
|
||
|
"rawSpec": "^2.0.4",
|
||
|
"spec": ">=2.0.4 <3.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/inquirer"
|
||
|
]
|
||
|
],
|
||
|
"_from": "external-editor@>=2.0.4 <3.0.0",
|
||
|
"_id": "external-editor@2.1.0",
|
||
|
"_inCache": true,
|
||
|
"_location": "/external-editor",
|
||
|
"_nodeVersion": "9.1.0",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "s3://npm-registry-packages",
|
||
|
"tmp": "tmp/external-editor-2.1.0.tgz_1510928081377_0.6571654360741377"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "mrkmg",
|
||
|
"email": "kevin@mrkmg.com"
|
||
|
},
|
||
|
"_npmVersion": "5.5.1",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "external-editor@^2.0.4",
|
||
|
"scope": null,
|
||
|
"escapedName": "external-editor",
|
||
|
"name": "external-editor",
|
||
|
"rawSpec": "^2.0.4",
|
||
|
"spec": ">=2.0.4 <3.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/inquirer"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz",
|
||
|
"_shasum": "3d026a21b7f95b5726387d4200ac160d372c3b48",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "external-editor@^2.0.4",
|
||
|
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/inquirer",
|
||
|
"author": {
|
||
|
"name": "Kevin Gravier",
|
||
|
"email": "kevin@mrkmg.com",
|
||
|
"url": "https://mrkmg.com"
|
||
|
},
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/mrkmg/node-external-editor/issues"
|
||
|
},
|
||
|
"dependencies": {
|
||
|
"chardet": "^0.4.0",
|
||
|
"iconv-lite": "^0.4.17",
|
||
|
"tmp": "^0.0.33"
|
||
|
},
|
||
|
"description": "Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT",
|
||
|
"devDependencies": {
|
||
|
"chai": "^4.0.0",
|
||
|
"coffee-script": "^1.10.0",
|
||
|
"coffeelint": "^1.14.2",
|
||
|
"mocha": "^3.2.0"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==",
|
||
|
"shasum": "3d026a21b7f95b5726387d4200ac160d372c3b48",
|
||
|
"tarball": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz"
|
||
|
},
|
||
|
"engines": {
|
||
|
"node": ">=0.12"
|
||
|
},
|
||
|
"files": [
|
||
|
"main",
|
||
|
"example_sync.js",
|
||
|
"example_async.js"
|
||
|
],
|
||
|
"gitHead": "056e00b7a8d0ad397590a7746aa7299d070eaccd",
|
||
|
"homepage": "https://github.com/mrkmg/node-external-editor#readme",
|
||
|
"keywords": [
|
||
|
"editor",
|
||
|
"external",
|
||
|
"user",
|
||
|
"visual"
|
||
|
],
|
||
|
"license": "MIT",
|
||
|
"main": "main/index.js",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "mrkmg",
|
||
|
"email": "kevin@mrkmg.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "external-editor",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# External Editor\n\n[![ExternalEditor on Travis CI](https://img.shields.io/travis/mrkmg/node-external-editor.svg?style=flat-square)](https://travis-ci.org/mrkmg/node-external-editor/branches)\n[![ExternalEditor on NPM](https://img.shields.io/npm/v/external-editor.svg?style=flat-square)](https://www.npmjs.com/package/external-editor)\n[![ExternalEditor uses the MIT](https://img.shields.io/npm/l/external-editor.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\n\nA node module to edit a string with a users preferred text editor using $VISUAL or $ENVIRONMENT.\n\nVersion: 2.1.0\n\nAs of version 2.0.0, node 0.10 is no longer support. Minimum node version is now 0.12.\n\n## Install\n\n`npm install external-editor --save`\n\n## Usage\n\nA simple example using the `.edit` convenience method\n\n var ExternalEditor = require('external-editor')\n var data = ExternalEditor.edit('\\n\\n# Please write your text above');\n console.log(data);\n\nA full featured example\n\n var ExternalEditor = require('external-editor');\n \n try {\n var editor = new ExternalEditor();\n var text = editor.run()\n // the text is also available in editor.text\n } catch (err) {\n if (err instanceOf ExternalEditor.CreateFileError) {\n console.log('Failed to create the temporary file');\n } else if (err instanceOf ExternalEditor.ReadFileError) {\n console.log('Failed to read the temporary file');\n } else if (err instanceOf ExternalEditor.LaunchEditorError) {\n console.log('Failed to launch your editor');\n } else {\n throw err;\n }\n }\n \n // Do things with the text\n \n // Eventually call the cleanup to remove the temporary file\n try {\n editor.cleanup(); \n } catch (err) {\n if (err instanceOf ExternalEditor.RemoveFileError) {\n console.log('Failed to remove the temporary file');\n } else {\n throw err\n }\n }\n \n \n#### API\n**Static Methods**\n\n- `edit(text)`\n - `text` (string) *Optional* Defaults to empty string\n - **Returns** (string) The contents of the file\n - Could throw `CreateFileError`, `ReadFileError`, or `LaunchEditorError`, or `RemoveFileError`\n- `editAsync(text, callback)`\n - `text` (string) *Optional* Defaults to empty string\n - `callback` (function (error, text))\n - `error` could be of type `CreateFileError`, `ReadFileError`, or `LaunchEditorError`, or `RemoveFileError`\n - `text`(string) The contents of the file \n\n\n**Static Properties**\n\n- `CreateFileError` Error thrown if the temporary file could not be created. \n- `ReadFileError` Error thrown if the temporary file could not be read.\n- `RemoveFileError` Error thrown if the temporary file could not be removed during cleanup.\n- `LaunchEditorError` Error thrown if the editor could not be launched.\n\n**Public Methods**\n\n- `new ExternalEditor(text)`\n - `text` (string) *Optional* Defaults to empty string\n - Could throw `CreateFileError`\n- `run()` Launches the editor.\n - **Returns** (string) The contents of the file\n - Could throw `LaunchEditorError` or `ReadFileError`\n- `runAsync(callback)` Launches the editor in an async way\n - `callback` (function (error, text))\n - `error` could be of type `ReadFileError` or `LaunchEditorError`\n - `text`(string) The contents of the file\n- `cleanup()` Removes the temporary file.\n - Could throw `RemoveFileError`\n \n**Public Properties**\n\n- `text` (string) *readonly* The text in the temporary file.\n- `editor.bin` (string) The editor determined from the environment.\n- `editor.args` (array) Default arguments for the bin\n- `temp_file` (string) Path to temporary file. Can be changed, but be careful as the temporary file probably already \n exists and would need be removed manually.\n \n## Errors\n\nAll errors have a simple message explaining what went wrong. They all also have an `original_error` property containing\nthe ori
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+https://github.com/mrkmg/node-external-editor.git"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"compile": "coffee --compile --output main/ src/",
|
||
|
"lint": "coffeelint -f .coffeelint.json src",
|
||
|
"test": "npm run lint && npm run unit",
|
||
|
"unit": "mocha --recursive --compilers coffee:coffee-script/register --timeout 10000 ./test/spec"
|
||
|
},
|
||
|
"version": "2.1.0"
|
||
|
}
|