editor-in

0.2.0 • Public • Published

Editor In

Opens an editor, gets the result after the process has exited

Install:

npm install editor-in

Usage:

var editorIn = require('editor-in');
 
// Opens process.env.EDITOR
editorIn( function( error, result ){
  // result is a Buffer
  console.log( result.toString() );
});

Editor In

API

This module exports a single function

editorIn( [options], callback )

Opens a temporary file in options.editor or process.env.EDITOR and returns the result.

Options:

// Options and defaults
{
  // Editor to use Ex: 'vim'
  editor:         process.env.EDITOR || 'vi'
  // Initial content for the editor
, content:        ''
  // Prefix of tmp filename Ex: 'some-file-'
, tmpFilePrefix:  ''
  // Suffix of tmp filename Ex: '.md'
, tmpFilePostfix: ''
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.012latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.012
0.1.20
0.1.10

Package Sidebar

Install

npm i editor-in

Weekly Downloads

9

Version

0.2.0

License

BSD-2-Clause

Last publish

Collaborators

  • johndotawesome