# organic-dna-fsloader

> File System based loading of dna methods.

Latest version **1.1.4** (published 2022-05-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install organic-dna-fsloader
pnpm add organic-dna-fsloader
yarn add organic-dna-fsloader
bun add organic-dna-fsloader
```

## 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.4 |
| Published | 2022-05-07 |
| First published | 2014-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Boris Filipov |
| Maintainers | outbounder |

## Links

- npm: https://www.npmjs.com/package/organic-dna-fsloader
- Repository: https://github.com/node-organic/organic-dna-fsloader
- Issues: https://github.com/node-organic/organic-dna-fsloader/issues
- npm.io page: https://npm.io/package/organic-dna-fsloader

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ^7.2.0
- [yaml](https://npm.io/package/yaml.md) ^1.10.2
- [organic-dna-branches](https://npm.io/package/organic-dna-branches.md) ^1.0.0

## Recent versions

- 1.1.4 (latest) — 2022-05-07
- 1.1.3 — 2021-12-06
- 1.1.2 — 2021-12-06
- 1.1.1 — 2019-03-08
- 1.1.0 — 2019-03-08
- 1.0.0 — 2019-01-23
- 0.0.2 — 2014-08-26
- 0.0.1 — 2014-08-26

## README

# organic-dna-fsloader

File System based loading of dna methods.

# api

## loadDir(dna, dirPath, [ namespace, ] callback)

Loads all (.json|.yaml|.yml) files found recursively in `dirPath` and mounts constructed object into `dna`.

* `dna`: Object - the dna instance on which will contain the loaded data
* `dirPath`: String - path to directory containing .json files
* `namespace`: String - optional, dot notated path to existing branch which should hold loaded data. By default it is '' pointing to the root of the `dna` reference.
* `callback`: Function(err){} - will be invoked once loading is complete
  
Uses internally `loadFile` method

## loadFile(dna, filePath, [ namespace, ] callback)

Loads a single file (.json|.yaml|.yml) parsing its contents as JSON structure and mounts into `dna`.

* `dna`: Object - the dna instance on which will contain the loaded data
* `filePath`: String - path to file containing JSON structure
* `namespace`: String - optional, dot notated path to existing branch which should hold loaded data. By default it is '' pointing to the root of the `dna` reference.
* `callback`: Function(err){} - will be invoked once loading is complete
  
YAML support includes parsing single or multi-document yaml files.
Loading .json and .yaml files for the same namespace merges their contents.

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