open-index/open-npm huggingface dataset:
npm package: @house-agency/profs
Description: Promise-versions of filesystem functions
Author: Jonas Nilsson
Latest version: 1.0.0

# profs - Promisified Filesystem Functions

## Installation

    npm install profs --save-dev

## Usage

```
const fs = require('profs');

fs.copy('path/to/source', 'path/to/target')
	.catch((e) => { console.warn(e) })
	.then(() => { console.log('Copy successful!') })
```

## Functions

#### copy(source, target) → {Promise}
Copy file or a directory and all its content. Uses [ncp](https://www.npmjs.com/package/ncp).

__ Example __

	fs.copy('path/to/source', 'path/to/target')

#### delete(path) → {Promise}

Delete file.

__ Example __

    fs.delete('path/to/file')

#### mkdir(path) → {Promise}

Create directories. Will create all directories that doesn't exist. Uses [mkdirp](https://www.npmjs.com/package/mkdirp).

__ Example __

    fs.mkdir('path/to/dir')

#### read(path) → {Promise}

Read a file.

__ Example __

	fs.read('path/to/file')


#### rmdir(path) → {Promise}
Delete a directory and all its content. Uses [rmdir](https://www.npmjs.com/package/rmdir).

__ Example __

	fs.rmdir('path/to/dir')

#### stat(path) → {Promise}
Get file or directory status. Can be used to see if something exists.

__ Example __

	fs.stat('path/to/something')
		.catch((e) => { console.log('Does not exist')})
		.then((data) => { console.log('Does exist:', data) })

#### write(path, content) → {Promise}
Write file content.

__ Example __

	fs.write('path/to/file', 'file content')