deoxen0n2 / tmp-editor

Node.js temp file editing with `$EDITOR`.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tmp-editor

js-standard-style

Temp file editing with $EDITOR. Get string from that file when finish.

Install

$ npm-install --save tmp-editor

Usage

  var tmpEditor = require('tmp-editor')

  tmpEditor().then(function handleSuccess (text) {
    console.log('Text:', text)
  }).catch(function handleFailure (error) {
    console.log('Edit error:', error)
  })

Promise and Callback

This module uses native Promise from Node 0.12.x and later for promise interface but standard node callback is also available: tmpEditor(function onComplete (error, text) { ... }).

License

MIT. Copyright (c) Saran Siriphantnon.

About

Node.js temp file editing with `$EDITOR`.


Languages

Language:JavaScript 100.0%