fx45-node
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

fx45-node

MEAN Module Build Status npm version Node.js Version

Generate JSON files for fx54-node.

The packages names may be slightly confusing:

  • fx54-node Verify the existence or content of files in a hierarchical object.
  • fx45-node Generate JSON files for fx54-node.

Installation

yarn add fx45-node

Run tests

yarn test

Example

Assume a directory with following structure:

- root
  - dir1
    a.txt 
  - dir2
    b.txt

Code:

import objectFromDirectory from 'fx45-node';
// or Node.js style: const objectFromDirectory = require('fx45-node').default;
 
console.log(JSON.stringify(objectFromDirectory('./root')));

Output:

{
  "dir1": {
    "a.txt": "Contents of a.txt"
  },
  "dir2": {
    "b.txt": "Contents of b.txt"
  }
}

API

import objectFromDirectory from 'fx45-node';
 
objectFromDirectory(directory: string, ignoredFiles: string[]|null = null): object|null
  • ignoredFiles files to be ignored, e.g. ['.DS_Store', 'thumbs.db'].

Readme

Keywords

Package Sidebar

Install

npm i fx45-node

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

5.96 kB

Total Files

6

Last publish

Collaborators

  • mgenware