auto-run

When Atom finishes loading, it will dispatch.

aki77

4,866

2

0.2.1

MIT

GitHub

This package provides the following services:

auto-run package

When Atom finishes loading, it will dispatch. Build Status

Settings

Gyazo

API

This package provides a service that you can use in other Atom packages.

Then, in your package's main module, call methods on the service:

module.exports =
  config:
    autoRun:
      type: 'boolean'
      default: false
      description: 'Requirement: auto-run package'

  activate: ->
    @subscriptions = new CompositeDisposable
    @subscriptions.add atom.commands.add 'atom-workspace',
      'my-package:start': => @start()

  activateConfig: ->
    pack = atom.packages.getActivePackage('auto-run')
    return unless pack

    autoRun = pack.mainModule.provideAutoRun()
    autoRun.registerCommand(
      keyPath: 'my-package.autoRun'
      command: 'my-package:start'
    )

package.json

{
  "name": "my-package",
  "activationCommands": {
    "atom-workspace": ["my-package:start"]
  }
}