https://github.com/atom/autosave
Autosaves buffers when they lose focus
https://github.com/atom/autosave
Last synced: 3 months ago
JSON representation
Autosaves buffers when they lose focus
- Host: GitHub
- URL: https://github.com/atom/autosave
- Owner: atom
- License: mit
- Archived: true
- Created: 2013-10-29T00:28:59.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-09-28T10:52:01.000Z (over 2 years ago)
- Last Synced: 2024-10-30T08:51:20.606Z (7 months ago)
- Language: JavaScript
- Size: 95.7 KB
- Stars: 63
- Watchers: 19
- Forks: 29
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
##### Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our [official announcement](https://github.blog/2022-06-08-sunsetting-atom/)
# Autosave package
[](https://travis-ci.org/atom/autosave) [](https://ci.appveyor.com/project/Atom/autosave/branch/master) [](https://david-dm.org/atom/autosave)Autosaves editor when they lose focus, are destroyed, or when the window is closed.
This package is disabled by default and can be enabled via the `autosave.enabled` config
setting or by checking *Enabled* in the settings for the *autosave* package in the
Settings view.## Service API
The service exposes an object with a function `dontSaveIf`, which accepts a callback.
Callbacks will be invoked with each pane item eligible for an autosave and if the callback
returns true, the item will be skipped.### Usage
#### package.json
``` json
"consumedServices": {
"autosave": {
"versions": {
"1.0.0": "consumeAutosave"
}
}
}
```#### package initialize
``` javascript
consumeAutosave({dontSaveIf}) {
dontSaveIf(paneItem -> paneItem.getPath() === '/dont/autosave/me.coffee')
}
```