node-dir-to-obj
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

node-dir-to-obj

Build Status npm version Node.js Version

Convert the contents of a directory to an object.

Installation

npm i node-dir-to-obj

Usage

Suppose a directory structure like this:

a.txt
subDir
-- b.txt
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.

Readme

Keywords

none

Package Sidebar

Install

npm i node-dir-to-obj

Weekly Downloads

0

Version

0.2.0

License

BSD-3-Clause

Unpacked Size

6.99 kB

Total Files

6

Last publish

Collaborators

  • mgenware