# allex_directoryservice

> DirectoryService

Latest version **1.0.4** (published 2024-01-08) · ISC license · 0 weekly downloads

## Install

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

## 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.0.4 |
| Published | 2024-01-08 |
| First published | 2017-07-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 65.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | HERS Belgrade |
| Maintainers | andrija-hers, veljkopopovic |
| Keywords | ecosystem:allex, Service, Directory |

## Links

- npm: https://www.npmjs.com/package/allex_directoryservice
- Repository: https://github.com/allex-services/directory
- Homepage: https://github.com/allex-services/directory#readme
- Issues: https://github.com/allex-services/directory/issues
- npm.io page: https://npm.io/package/allex_directoryservice

## Recent versions

- 1.0.4 (latest) — 2024-01-08
- 1.0.3 — 2022-10-05
- 1.0.2 — 2020-01-30
- 1.0.1 — 2019-09-18
- 1.0.0 — 2017-07-19
- 0.0.1 — 2017-07-18

## README

# DirectoryService
AllexJS service that takes care of a given directory.

## `path`
The path to the directory __must__ be given in the propertyhash for the
constructor, or the constructor will `throw` an error.

The path may be:
- relative (to the current working directory of the running `allexmaster`, that
is the directory where `allexmaster.pid` resides)
- absolute (to the root of the file system)

The directory will be:
- opened if it exists
- created if it doesn't exist

## File operations
These are:
- read
- write
- append

### File paths
For any operation, a path to the file must be given.

The path to the file will __always__ be treated __relative__ to the directory's
path.

### File operation modes
File operations may be done in
- raw mode
- parse mode

## Writing to files
When smaller data chunks have to be written to file, use the `writeToFile` task
provided by the `DirectoryService`.

For large data payloads, use the 'transmitFile' task provided by the
`DirectoryService`.

## Reading files
For smaller files (or smaller payloads, like "_record by record_" mode), use the
'readFile' task provided by the `DirectoryService`.

For larger files, use the 'downloadFile' task provided by the `DirectoryService`.

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