cista

0.0.3 • Public • Published

Cista Build Status

Create and manipulate a temporary project.

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

NPM

Install

npm install cista

Usage

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}

The list of files in the temporary project.

.files[fileName] {String}

Read, change or write the content of a single file.

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

Package Sidebar

Install

npm i cista

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

5.12 kB

Total Files

6

Last publish

Collaborators

  • t0mas