dirmap
v0.0.2
Published
Accepts a dir path and returns an object mapping file names to their full path
Downloads
59
Readme
dirmap
/**
* Accepts a dir path and returns an object mapping file names to their full
* path. If dropExtension is true, the file extension is dropped from the
* object keys. Does not recurse into directories.
*
* @param {string} dir
* @param {boolean} dropExtension
* @returns {object}
*/
Installation
npm install dirmap
Example
var dirmap = require('dirmap');
dirmap('.', true);
// { '.git': '/Users/danielstjules/dirmap/.git',
// '.gitignore': '/Users/danielstjules/dirmap/.gitignore',
// LICENSE: '/Users/danielstjules/dirmap/LICENSE',
// README: '/Users/danielstjules/dirmap/README.md',
// index: '/Users/danielstjules/dirmap/index.js',
// package: '/Users/danielstjules/dirmap/package.json' }