# cista

> Create and manipulate a temporary project

Latest version **0.0.3** (published 2018-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install cista
pnpm add cista
yarn add cista
bun add cista
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-03-27 |
| First published | 2018-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Tomas Miliauskas |
| Maintainers | t0mas |
| Keywords | temp, tmp, temporary, path, file, directory, dir, folder, project, test, testing |

## Links

- npm: https://www.npmjs.com/package/cista
- Repository: https://github.com/tqmukas/cista
- Homepage: https://github.com/tqmukas/cista#readme
- Issues: https://github.com/tqmukas/cista/issues
- npm.io page: https://npm.io/package/cista

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ~7.1.0
- [mkdirp](https://npm.io/package/mkdirp.md) ~0.5.0
- [rimraf](https://npm.io/package/rimraf.md) ~2.6.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2018-03-27
- 0.0.2 — 2018-03-27
- 0.0.1 — 2018-03-27

## README

# Cista [![Build Status](https://travis-ci.org/tqmukas/cista.svg?branch=master)](https://travis-ci.org/tqmukas/cista)
Create and manipulate a temporary project.

Might be useful to test node tools that interact with the file system.

[![NPM](https://nodei.co/npm/cista.png)](https://nodei.co/npm/cista/)

## Install
`npm install cista`

## Usage
```js
const cista = require('cista');

const fileTree = {
  'src/app.js': ';',
  'package.json': '{}'
};

const project = cista(fileTree);
```

## API
### .dir {String}
Path to the temporary project.

### .files {Object}
Retrieve and modify files in the temporary directory.

#### .files.list {Array<String>}
The list of files in the temporary project.

#### .files[fileName] {String}
Read, change or write the content of a single file.

```js
const {files} = cista(fileTree);

console.log(files['src/app.js']); // Outputs `;`

project.files['src/app.js'] = 'break;';

console.log(files['src/app.js']); // Outputs `break;`
```

### .cleanup()
Delete the temporary project from file system.

## License
[MIT](/LICENSE)

---
_Source: https://npm.io/package/cista · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
