0.0.1 • Published 4 years ago

topo-files v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Installation

npm add --save sql-modules
yarn add sql-modules

Example

Given the following file structure:

files/
  fileA.txt
  fileB.txt
  fileC.txt

files/fileA.txt

# requires fileB
File A

files/fileB.txt

# requires fileC
File B

files/fileC.txt

File C

Point topoFiles at the files directory.

const path = require('path')
const {topoFiles} = require('topo-files')

const filesDir = path.join(__dirname, 'files')

const combined = topoFiles(filesDir, {
  ext: '.txt',
  comment: '#'
})

console.log(combined)

Outputs:

# File: fileC.txt
File C

# File: fileA.txt
# requires fileC
File B

# File: fileB.txt
# requires fileB
File A

Declaring file dependencies