Reload a package while developing


Trying to develop a package, how do I reload it without quitting the entire editor? I’m trying to use emissary and it’s saying the module can’t be found, despite the fact that the whitespace package uses it…

Reload package from disk without reloading editor
Experimenting with views without constantly reloading

I’m seeing the same thing. I think packages that’re in ~/.atom/packages aren’t able to resolve npm dependencies. If I move my in development package into /Applications/ it loads.

As for reloading, you can use Window: Reload.


Nope, that’s not true. It is possible.

How are you guys requiring your npm packages? Can you provide more details on the setup, and provide the package.json?


Simply copying an existing working package into ~/.atom/packages will reproduce the error.

cp -r /Applications/ ~/.atom/packages/markdown-preview2

Open Atom, in the DevTools: Failed to load package named 'markdown-preview2' Error: Cannot find module 'fs-plus'


Interesting, I can reproduce that. At the same time, I have another package I’m working on that does use an npm module, and that loads fine! I wonder what the difference is…



  "name": "gofmt",
  "main": "./lib/main",
  "version": "0.0.0",
  "description": "Runs gofmt on your code",
  "repository": "",
  "license": "MIT",
  "engines": {
    "atom": ">0.50.0"
  "dependencies": {
    "emissary": "1.x"


Gofmt = require('./gofmt')

module.exports =
    pathToBinary: 'gofmt'
    tabs: true
    tabWidth: 8

  activate: ->
    console.log("starting gofmt")
    @gofmt = new Gofmt()

  deactivate: ->


Subscriber = require('emissary').Subscriber
Spawn = require('child_process').spawn

class Gofmt

  constructor: ->
    atom.workspace.eachEditor (editor) =>
      console.log("new editor")

  destroy: ->

  handleSave: (editor) ->
    buffer = editor.getBuffer()
    @subscribe buffer, 'saved', =>
      path = editor.getUri()
      Spawn("gofmt #{path}")

    @subscribe buffer, 'destroyed', =>

module.exports = Gofmt

The error is that it can’t find module emissary.


You can also use the keybinding for reloading which is ctrl-opt-cmd-L.


@darkhelmetlive Not sure if you have figured it out yet, but you have to run apm install in your directory to pull in node dependencies. Then you can carry on with your plugin in ~/.atom/packages


For now, or at least on Linux, it is ctrl+alt+r


I’ve figured that since you were developing, you’re likely to have the chrome dev opened. Then CMD+R (CTRL+R windows and linux) should work. It does on my machine. Note that the focus needs to be on the Chrome dev tool.

Of course you can still run the 4 keys shortcuts (is-it?) ctrl+option+cmd+l.


I created a package autoreload-package-service, which reloades your package on file save. You simply download it, consume its service, set it up and are ready to go…