# node-dir-to-obj

> Convert the contents of a directory to an object.

Latest version **0.2.0** (published 2023-04-01) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install node-dir-to-obj
pnpm add node-dir-to-obj
yarn add node-dir-to-obj
bun add node-dir-to-obj
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-04-01 |
| First published | 2023-04-01 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14.0.0 |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mgenware |
| Maintainers | mgenware |

## Links

- npm: https://www.npmjs.com/package/node-dir-to-obj
- Repository: https://github.com/mgenware/node-dir-to-obj
- Issues: https://github.com/mgenware/node-dir-to-obj/issues
- npm.io page: https://npm.io/package/node-dir-to-obj

## Dependencies (1)

- [m-fs](https://npm.io/package/m-fs.md) ^5.2.0

## Recent versions

- 0.2.0 (latest) — 2023-04-01
- 0.1.2 — 2023-04-01
- 0.1.1 — 2023-04-01
- 0.1.0 — 2023-04-01

## README

# node-dir-to-obj

[![Build Status](https://github.com/mgenware/node-dir-to-obj/workflows/Build/badge.svg)](https://github.com/mgenware/node-dir-to-obj/actions)
[![npm version](https://img.shields.io/npm/v/node-dir-to-obj.svg?style=flat-square)](https://npmjs.com/package/node-dir-to-obj)
[![Node.js Version](http://img.shields.io/node/v/node-dir-to-obj.svg?style=flat-square)](https://nodejs.org/en/)

Convert the contents of a directory to an object.

## Installation

```sh
npm i node-dir-to-obj
```

## Usage

Suppose a directory structure like this:

```
a.txt
subDir
-- b.txt
```

```ts
import dirToObj from 'node-dir-to-obj';

const obj = await dirToObj('<dir path>');
/*
  {
    'a.txt': '<contents of a.txt>',
    sub: {
      'b.txt': '<contents of a.txt>',
    },
  }
*/
```

### Options

- `ignoreMap` a set of names that should be ignored.
- `textMode` dumps file contents as text instead of hex.

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