# koop-localfs

> A local filesystem plugin for koop

Latest version **1.1.2** (published 2018-11-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install koop-localfs
pnpm add koop-localfs
yarn add koop-localfs
bun add koop-localfs
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2018-11-29 |
| First published | 2016-04-14 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel Fenton |
| Maintainers | dmfenton, rgwozdz |
| Keywords | koop, filesystem, local |

## Links

- npm: https://www.npmjs.com/package/koop-localfs
- Repository: https://github.com/koopjs/koop-filesystem-local
- Homepage: https://github.com/koopjs/koop-filesystem-local#readme
- Issues: https://github.com/koopjs/koop-filesystem-local/issues
- npm.io page: https://npm.io/package/koop-localfs

## Dependencies (4)

- [config](https://npm.io/package/config.md) ^1.20.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.5.2
- [highland](https://npm.io/package/highland.md) ^2.7.4

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.1.2 (latest) — 2018-11-29
- 1.1.1 — 2016-06-08
- 1.1.0 — 2016-04-16
- 1.0.0 — 2016-04-14

## README

# Koop Local FS

[![Greenkeeper badge](https://badges.greenkeeper.io/koopjs/koop-filesystem-local.svg)](https://greenkeeper.io/)
*A filesystem plugin for koop that supports setting a root directory for all actions*

[![npm][npm-img]][npm-url]
[![travis][travis-image]][travis-url]

## Project goal

In order to allow different koop modules to write to local disk without specifying a machine specific absolute path, this module resolves all relative paths to the same base directory. So you can call`koop.fs.createReadStream('foo.txt')` and always know that you can open foo without changing the working directory.

## Usage

### In `default.json`

```json
{
  "filesystem": {
    "local": {
      "rootDir": "/var/koop/files"
    }
  }
}
```

### In `server.js`

```javascript
const config = require('config')
const koop = require('koop')(config)
const LocalFs = require('koop-localfs')

koop.register(LocalFs)
```

## Supported functions

- stat - Get information about a file
- createReadStream: create a readable stream from a file on disk
- createWriteStream: create a writeable stream you can pipe to
- writeFile: write a file to disk
- readFile: read a file from disk
- unlink: delete a file
- mkdir: make a directory
- rmdir: remove an empty directory
- rmdirp: recursively remove a directory and its contents
- realpathSync: resolve the absolute path when given a relative path


[npm-img]: https://img.shields.io/npm/v/koop-localfs.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/koop-localfs
[travis-image]: https://img.shields.io/travis/koopjs/koop-filesystem-local.svg?style=flat-square
[travis-url]: https://travis-ci.org/koopjs/koop-filesystem-local

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