node package manager

upfiles

Up Files

Library to autoload files using some configurable path.

Version: 1.2.0

Basic features

  1. AutoLoad
  • UpFiles(options)
  • include(arquivo)
  • then(arquivo)
  • exec()

Using upfiles

Default

upfiles({
    cwd: process.cwd(),
    locale: 'pt-br',
    extensions: ['.js','.json', '.node']
});

Getting Started

var upfiles = require('upfiles')({cwd: 'path'});
upfiles.include('file1.js')
    .then('file2.js')
    .exec();
console.log(upfiles.into); //Return data files in objects 

OR

var upfiles = require('upfiles');
var dataFiles = upfiles()
                .include('folder1')
                .then('folder2')
                .exec();
console.log(dataFiles); //Return data files in objects 

OR

const app = require(express)();
var upfiles = require('upfiles');
var dataFiles = upfiles()
                .include('folder1')
                .then('folder2')
                .exec(app); //Concat functions express with dataFiles 
console.log(dataFiles); //Return data files in objects 

Note

All imported files must have u like module.exports

Example:

//object.js

exports.object = {name: "upfiles"};
 
OR
 
var object = {name: "upfiles"};
module.exports = object;
 

//function.js

exports.func1 = function(){
    return this;
};
 
OR
 
function func1(){
    return this;
};
module.exports = func1;
 

Install

$ npm install upfiles --save