1.0.4 ā€¢ Published 2 years ago

safeloaderjs v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

SafeloaderJS šŸ‘Øā€šŸ’»

npm version

NPM Downloads

PackageBuild

SafeloaderJS - Features

  • SafeLoaderJS will help handle the relative path configaration.
  • SafeLoaderJS also works in single instance.

Please report bugs there on Github.


Old method

const HomeController = require('../../HomeController');
// šŸ˜­  When we use it with this old method we have provide the relative path every time to load or import the files from other modules.

We have simplified this process by using the SaferLoaderJS.

Example

šŸŒ router.js

require('safeloaderjs'); // it's very important that we have to use it on top of our code.
let  express  =  require('express');
let  router  =  express.Router(); 
let HomeController = require('@Ctrl/HomeController.js');

router.get('/',HomeController);
module.exports = router;

.paths configaration

@Ctrl = /Controllers/

SafeLoaderJS - v1.0

  • If the path not provided it takes the default path.
  • Even if you import this modules in multiple file it use the single instance.

License

MIT

Reference

GitHub


1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago