@eugabrielsilva/js-include

1.0.0 • Public • Published

js-include

This library allows you to include, in-place, common Javascript files (not modules) into your Node.js application and evaluate their script in the global namespace, kind like PHP does.

Installation

npm install @eugabrielsilva/js-include

Usage (single file)

// Declare the module
const includes = require('@eugabrielsilva/js-include');

// Include the file
includes.__includeFile('./inc/myfile.js');
eval(includes.myfile);

Usage (directory)

// Declare the module
const includes = require('@eugabrielsilva/js-include');

// Include the directory
includes.__includeDir('./inc');

for (let file in includes.inc) {
    eval(includes.inc[file]);
}

Credits

Library developed and currently maintained by Gabriel Silva.

Readme

Keywords

none

Package Sidebar

Install

npm i @eugabrielsilva/js-include

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.38 kB

Total Files

4

Last publish

Collaborators

  • eugabrielsilva