• Packages
  • Themes
  • Documentation
  • Blog
  • Discussions
Sign in

autoreload-package-service

a reloader for atom packages
  • #reloader
paulpflug
0.0.4 769
0
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

autoreload-package-service

provides a service which other packages can use to reload on file change

autoreload-package-service

Only works in dev mode!

Usage

package.json

{
  ...
  "consumedServices": {
    "autoreload": {
      "versions": {
        "^0.0.1": "consumeAutoreload"
      }
    }
  }
  ...
}

your package:

  #in main module 
  consumeAutoreload: (reloader) ->
    reloader(pkg:"nameOfYourPackage",files:["package.json"],folders:["lib/"])
    # pkg has to be the name of your package and is required 
    # files are watched and your package reloaded on changes, defaults to ["package.json"] 
    # folders are watched and your package reloaded on changes, defaults to ["lib/"] 

Keep in mind, the service wont be loaded if your activate function throws an error. This is recommended:

  #in main module 
  activate: ->
    realActivate = ->
      #do your stuff 
    if atom.inDevMode()
      try
        realActivate()
      catch e
        console.log e
    else
      realActivate()
  #make sure your deactivate wont throw, even when realActivate wasn't successful 
  deactivate: ->
    somestuff?.dispose()

License

Copyright (c) 2015 Paul Pflugradt Licensed under the MIT license.

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by