New package "Run in Atom", it's mainly useful for developing packages


#1

I’ve published a new package called Run in Atom, it’s all about running CoffeeScript or JavaScript in the context of Atom itself. In other words, you can write code that can inspect or manipulate Atom and run it instantly. For example, running the following code will split the current pane horizontally:

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

Run in Atom provides three ways to execute CoffeeScript or JavaScript in Atom: 1. The right-click contextual menu, 2. A “Run In Atom” command, 3. A cmd-k r keyboard shortcut. In all three cases, it will run the selected text or the whole document if nothing is selected.

For me, this package changed the way I work Atom packages (and probablycorey’s coffee-eval, mentioned below). Now I keep a CoffeeScript scratch pad file open at all times to try things out and I’m always selecting and running things like atom.workspace.getActivePaneItem() to make sure it returns what I expect it to.

This packaged started out as a fork of probablycorey’s coffee-eval but I felt like I wanted to make enough changes that it justified creating a new package. The same development process can be accomplished using Coffee-Eval, so definitely check that out too if you’re interested in developing packages this way.

Hope others find it useful, thanks!