Skip to content

robenkleene/run-in-atom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.getActiveTextEditor()
editor.getText()

Contextual Menu

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

pane = atom.workspace.getActivePane()
editor = atom.workspace.getActiveTextEditor()
pane.splitDown(items: [atom.workspace.buildTextEditor()])

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.

  • alt-cmd-r keyboard shortcut
  • Choosing "Run In Atom" from the command palette
  • Choosing "Run in Atom" from the contextual menu

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

  • Both CoffeeScript and JavaScript are supported.
  • Coffee Eval's output window has been removed.
  • There's a configuration option to automatically open the developer tools when code is run.
  • Code can by run from the contextual menu.
  • In GitHub Flavored Markdown, code can be run in fenced code blocks.

About

Run CoffeeScript or JavaScript in Atom.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5