run-in-atom

Runs CoffeeScript or JavaScript in Atom

robenkleene

16,073

17

1.0.5

MIT

GitHub

Run in Atom package Build Status

Run in Atom is an Atom package that allows code to be executed in the context of Atom itself. This means code can examine and manipulate Atom's state while it's running.

For example, running the following CoffeeScript with Run in Atom will log the contents of the current document to the console.

editor = atom.workspace.activePaneItem
editor.getText()

Contextual Menu

Example of calling asynchronous CoffeeScript with "Run In Atom" that triggers a visible UI change:

activePane = atom.workspaceView.getActivePaneView()
atom.project.open().then (editor) ->
  activePane.splitDown(editor)

Command Palette

Documentation

Code can be run in the following ways. In all cases it runs the selection if it exists, otherwise the whole document. The code's result is logged to the console.

This package is based on code from probablycorey's coffee-eval, with the following differentiating features: