top of page

Rekuire | a module for NodeJS

  • Aug 17, 2015
  • 1 min read

Updated: Jun 27, 2019



Just wanted to share a nice piece of code I created..

During my recent experience with NodeJs, there was one thing that bugged me the most – in Node, to include another module into the scope, you use ‘require()‘ to import the other module.

The thing is, that if it is not a third party module, you have to specify the full path in your project (absolute or relative) in order to do so. it usually looks something like this:

require('../../../commands/MyCommand.js');

Not only it is ugly, it is terribly hard to refactore the code afterwards (IntelliJ’s refactoring fails to do it).

So, I created this module called rekuire.

rekuire scans the project paths upon first execution, so all you need to specify, is the file name! no paths! (it saves a bunchload of time)

rekuire('MyCommand.js');

In order install, using npm, type “npm install rekuire“! And don’t forget, you are more then welcome to check it out and contribute to it on github. 🙂


 
 
 

Comments


The Latest Posts:

  • _EngineeringProductivity
  • _EngineeringProductivity

Code Migrations Don't Have to Hurt. This is how switched from cross team manual work to an automatic infrastructure

  • _AIEngineering
  • _AIEngineering

The End of Determinism: What’s Left for Engineers When AI Writes the Code

  • _AIEngineering
  • _AIEngineering

How to Build AI Agents That Fix Themselves - Without Bigger Prompts, More Context, or Another LLM

bottom of page