Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atom/autosave
Autosaves buffers when they lose focus
https://github.com/atom/autosave
Last synced: about 2 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 (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-09-28T10:52:01.000Z (almost 2 years ago)
- Last Synced: 2024-07-03T12:13:02.173Z (3 months ago)
- Language: JavaScript
- Size: 95.7 KB
- Stars: 64
- Watchers: 20
- Forks: 34
- 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
[![OS X Build Status](https://travis-ci.org/atom/autosave.svg?branch=master)](https://travis-ci.org/atom/autosave) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/3aktr9updp722fqx/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/autosave/branch/master) [![Dependency Status](https://david-dm.org/atom/autosave.svg)](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')
}
```