Skip to content

btmills/importify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here Be Footguns

Why just require a module when you can importify its contents into the global scope??

This is normally a Bad Idea. Like putting with (require('<module>')) {...} around your entire file. Only do it if you're really sure.

Usage

npm install https://github.com/btmills/importify/tarball/master

IncrediblyUsefulModule.js:

module.exports = {
    MAGICNUMBER: 42,
    EVILNUMBER: 13
};

YourAwesomeProgram.js:

var importify = require('importify');
importify(require('./IncrediblyUsefulModule'));


console.log(MAGICNUMBER); // 42
console.log(EVILNUMBER); // 13

License

Released under the BSD 3-Clause license, the full text of which can be read in LICENSE.

About

Lets you do Bad Things to the global scope in Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published