Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lambdalisue/deno-sandbox
🦕 Create a temporary sandbox directory and temporary move into it
https://github.com/lambdalisue/deno-sandbox
deno sandbox temporary
Last synced: 3 months ago
JSON representation
🦕 Create a temporary sandbox directory and temporary move into it
- Host: GitHub
- URL: https://github.com/lambdalisue/deno-sandbox
- Owner: lambdalisue
- License: mit
- Created: 2021-06-28T19:17:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-26T06:51:18.000Z (5 months ago)
- Last Synced: 2024-10-23T23:26:21.939Z (4 months ago)
- Topics: deno, sandbox, temporary
- Language: TypeScript
- Homepage: https://jsr.io/@lambdalisue/sandbox
- Size: 51.8 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sandbox
[![JSR](https://jsr.io/badges/@lambdalisue/sandbox)](https://jsr.io/@lambdalisue/sandbox)
[![Test](https://github.com/lambdalisue/deno-sandbox/actions/workflows/test.yml/badge.svg)](https://github.com/lambdalisue/deno-sandbox/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/lambdalisue/deno-sandbox/graph/badge.svg?token=AEZJlup3Et)](https://codecov.io/gh/lambdalisue/deno-sandbox)This module provides `sandbox()` and `sandboxSync()` function to create a
temporary sandbox directory and temporary move into it.## Usage
```ts
import { sandbox, sandboxSync } from "@lambdalisue/sandbox";{
await using sbox = await sandbox();
// The current working directory is changed to the sandbox directory here.
// Do what ever you want
}
// The current working directory is changed back to the original directory here.{
using sbox = sandboxSync();
// The current working directory is changed to the sandbox directory here.
// Do what ever you want
}
// The current working directory is changed back to the original directory here.
```## License
The code follows MIT license written in [LICENSE](./LICENSE). Contributors need
to agree that any modifications sent in this repository follow the license.