0.0.1 • Published 6 years ago
topo-files v0.0.1
Installation
npm add --save sql-modules
yarn add sql-modulesExample
Given the following file structure:
files/
fileA.txt
fileB.txt
fileC.txtfiles/fileA.txt
# requires fileB
File Afiles/fileB.txt
# requires fileC
File Bfiles/fileC.txt
File CPoint 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 ADeclaring file dependencies
0.0.1
6 years ago