provides a service which other packages can use to reload on file change
package.json
{..."consumedServices": {"autoreload": {"versions": {"^0.0.1": "consumeAutoreload"}}}...}
your package:
#in main moduleconsumeAutoreload: (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 moduleactivate: ->realActivate = ->#do your stuffif atom.inDevMode()tryrealActivate()catch econsole.log eelserealActivate()#make sure your deactivate wont throw, even when realActivate wasn't successfuldeactivate: ->somestuff?.dispose()
Copyright (c) 2015 Paul Pflugradt Licensed under the MIT license.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.