diff options
author | isaacs <i@izs.me> | 2014-06-06 09:37:15 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-06-06 09:37:15 +0400 |
commit | 38267dc2cd63fddb037ca9fb474f3e387da4cb99 (patch) | |
tree | bcca610d506fcad840e44dbc449d8e2136778949 /node_modules/editor | |
parent | 6d6f094e7b773939cc2525baa9567b9c981485eb (diff) |
editor@0.1.0
Diffstat (limited to 'node_modules/editor')
-rw-r--r-- | node_modules/editor/LICENSE | 31 | ||||
-rw-r--r-- | node_modules/editor/index.js | 12 | ||||
-rw-r--r-- | node_modules/editor/package.json | 25 |
3 files changed, 40 insertions, 28 deletions
diff --git a/node_modules/editor/LICENSE b/node_modules/editor/LICENSE index ee27ba4b4..8b856bc4a 100644 --- a/node_modules/editor/LICENSE +++ b/node_modules/editor/LICENSE @@ -1,18 +1,21 @@ -This software is released under the MIT license: +Copyright 2013 James Halliday (mail@substack.net) -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +This project is free software released under the MIT license: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/editor/index.js b/node_modules/editor/index.js index 8f1a3ebef..3774edbe3 100644 --- a/node_modules/editor/index.js +++ b/node_modules/editor/index.js @@ -9,18 +9,12 @@ module.exports = function (file, opts, cb) { var ed = /^win/.test(process.platform) ? 'notepad' : 'vim'; var editor = opts.editor || process.env.VISUAL || process.env.EDITOR || ed; + var args = editor.split(/\s+/); + var bin = args.shift(); - setRaw(true); - var ps = spawn(editor, [ file ], { customFds : [ 0, 1, 2 ] }); + var ps = spawn(bin, args.concat([ file ]), { stdio: 'inherit' }); ps.on('exit', function (code, sig) { - setRaw(false); - process.stdin.pause(); if (typeof cb === 'function') cb(code, sig) }); }; - -var tty = require('tty'); -function setRaw (mode) { - process.stdin.setRawMode ? process.stdin.setRawMode(mode) : tty.setRawMode(mode); -} diff --git a/node_modules/editor/package.json b/node_modules/editor/package.json index 36e5f7efa..963b5d29b 100644 --- a/node_modules/editor/package.json +++ b/node_modules/editor/package.json @@ -1,6 +1,6 @@ { "name": "editor", - "version": "0.0.5", + "version": "0.1.0", "description": "launch $EDITOR in your program", "main": "index.js", "directories": { @@ -33,11 +33,26 @@ "engine": { "node": ">=0.6" }, - "readme": "editor\n======\n\nLaunch $EDITOR in your program.\n\nexample\n=======\n\n``` js\nvar editor = require('editor');\neditor('beep.json', function (code, sig) {\n console.log('finished editing with code ' + code);\n});\n```\n\n***\n\n```\n$ node edit.js\n```\n\n![editor](http://substack.net/images/screenshots/editor.png)\n\n```\nfinished editing with code 0\n```\n\nmethods\n=======\n\n``` js\nvar editor = require('editor')\n```\n\neditor(file, opts={}, cb)\n-------------------------\n\nLaunch the `$EDITOR` (or `opts.editor`) for `file`.\n\nWhen the editor exits, `cb(code, sig)` fires.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install editor\n```\n\nlicense\n=======\n\nMIT\n", - "readmeFilename": "README.markdown", "bugs": { "url": "https://github.com/substack/node-editor/issues" }, - "_id": "editor@0.0.5", - "_from": "editor@latest" + "_id": "editor@0.1.0", + "dist": { + "shasum": "542f4662c6a8c88e862fc11945e204e51981b9a1", + "tarball": "http://registry.npmjs.org/editor/-/editor-0.1.0.tgz" + }, + "_from": "editor@latest", + "_npmVersion": "1.3.21", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "542f4662c6a8c88e862fc11945e204e51981b9a1", + "_resolved": "https://registry.npmjs.org/editor/-/editor-0.1.0.tgz" } |