FilesCollection
A Ampersand.js set of classes to provide tools to browse and manage files and directories (existing or not).
Originally written for grunt-gtfd, a grunt.js task to generate project wide documentation.
Usage
var FilesCollection = ; var filesCollection = filepath: 'index.js' filepath: 'fictive/filepath/scripts.js' filepath: 'fictive/filepath/styles.less' filepath: 'fictive/index.js' filepath: 'fictive/other-filepath/index' filepath: 'fictive/other-filepath/styles.less' ; var autogeneratedDirectory = filesCollection;autogeneratedDirectorydirname // ==> '.'autogeneratedDirectorybasename // ==> 'fictive'autogeneratedDirectoryisDir // ==> trueautogeneratedDirectoryisRootDir // ==> falseautogeneratedDirectoryfiles // ==> a collection with the files and directories var scriptFile = filesCollection;scriptFiledirname // ==> 'fictive/filepath'scriptFilebasename // ==> 'scripts.js'scriptFileisDir // ==> falsescriptFile // ==> '../index.js'
Documentation
Can be generated using npm run-script docs
and will be written in DOCUMENTATION.md
.
Test
Can be runned usin npm test
.
Author
Valentin Vago @zeropaper valentin.vago@gmail.com