https://github.com/bfontaine/vanish
:sparkles: Temporary files and directories made easy
https://github.com/bfontaine/vanish
go library temporary-files
Last synced: about 1 year ago
JSON representation
:sparkles: Temporary files and directories made easy
- Host: GitHub
- URL: https://github.com/bfontaine/vanish
- Owner: bfontaine
- License: mit
- Created: 2015-04-21T22:49:28.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-10-18T09:34:07.000Z (over 3 years ago)
- Last Synced: 2025-04-15T03:14:22.683Z (about 1 year ago)
- Topics: go, library, temporary-files
- Language: Go
- Homepage: https://godoc.org/github.com/bfontaine/vanish/vanish
- Size: 26.4 KB
- Stars: 28
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Vanish
**Vanish** is a minimal Go library to use temporary files and directories.
[](https://godoc.org/github.com/bfontaine/vanish/vanish)
[](https://travis-ci.org/bfontaine/vanish)
## Install
go get github.com/bfontaine/vanish/v2
## Usage
Vanish works with functions:
```go
package main
import "github.com/bfontaine/vanish/v2"
vanish.File(func(name string) {
// 'name' is a temporary file, use it here as you want, it’ll be deleted
// at the end of the function
})
vanish.Dir(func(name string) {
// here, 'name' is a directory
})
vanish.Env(func() {
// we can modify the environment here, it’ll be restored at the end of the
// function
})
```