eval-and-replace

Execute CoffeeScript, JavaScript or Shell code from the Atom editor and replace the code with the result

Moritz Kneilmann

414

2

Bug Reports

1.2.0

MIT

GitHub

eval-and-replace

Build Status

Execute CoffeeScript, JavaScript or Shell code from the Atom editor and replace the code with the result.

calc

calc

calc

calc

Install

apm install eval-and-replace

Commands

Commands Description Default keybinding
eval-and-replace:coffee Executes selected CoffeeScript code ctrl-shift-e ctrl-shift-c or ctrl-k ctrl-e
eval-and-replace:js Executes selected JavaScript code ctrl-shift-e ctrl-shift-j
eval-and-replace:shell Executes selected Shell code ctrl-shift-e ctrl-shift-s

Be careful with eval-and-replace:shell; nobody will prevent you from executing rm -rf /!

Shell environment variables

When executing shell code with eval-and-replace:shell you have access to these variables:

CoffeeScript / JS Context

CoffeeScript / JS code is executed in its own context, this means you can only use ECMAScript functions (i.e. norequire). But the same context is used for all selections, so you can reuse variables. Additionally you have access to these functions and variables:

License

This project is licensed under the terms of the MIT license. A copy of the license can be found in the root directory of the project in the file LICENSE.md.