0.2.0 • Published 1 year ago

node-dir-to-obj v0.2.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
1 year ago

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.
0.2.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago