Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
'rekuire' is basically node's 'require' without the relative paths!
It saves you TONS of time refactoring your code, and making it easily reusable. plus, it makes you code more readable = better!
to install, type
npm install rekuire
instead of doing this:
var MyModule = require('../../../MyModule.js');
<-- yuck!
you can now do this:
var rek = require('rekuire');
var myModule = rek('MyModule');
or that:
var myCoffee = rek('MyCoffee.coffee');
var myJson = rek('myJson.json');
var myModule = rek('src/api/MyModule');
####0.1.9
- Fixed a bug causing the scanner to fail, if the fetched file was named like a default method like 'toString'
####0.1.8
- Removed deprecated code -
rek().path(...)
will not work anymore, instead userek.path(...)
.- Fixed an issue of causing
rekuire
not to scan the folders correctly whennode_modules
was a symlink.- Added .npmignore to the package - so you won't get the test files when adding dependencies
####0.1.7
- Now you are able to describe ignored folders in your project inside the
package.json
file!
when 'rekuire' is first loaded into the project, it scans the source files locations, and stores them. so when you need them they are right there ready to use! no relative paths are needed! yeahy!
in order to tell the scanner, not to scan specific folders you can configure rekuire
not to scan folders right from the package.json
file:
...
"rekuire": {
"ignore": ["out", "dist/target", "client/app"]
}
...
or you can set it up by code:
var mypath = rek.ignore('out', 'target', 'static/js');
// you should only do it once in your code
if you want to resolve only the file location, for example, when you want to use proxyquire.
use:
var mypath = rek.path('MyModule');
// mypath = 'lib/classes/MyModule.js'
for more examples, I recommend you to checkout the spec file :)
####0.1.6
- Added colliding files paths to Ambiguity Error
####0.1.5
- Fixed a bug that causes failures when scanning a package with higher os privileges (thanks Dany!)
####0.1.4
- Added a method to ignore folders while searching the right files (for example, the js files in the server's static folder)
####0.1.3
- you can now rekuire file according to the relative path of the file
- Added support for index.js files inside a folder - can be retrieved by the folder path
####0.1.2
- Added support for .coffee files and .json
if you are having any problems, requests or criticism, don't hesitate to open an issue, here
To test, run: npm test
FAQs
'rekuire' is basically node's 'require' without the relative paths
The npm package rekuire receives a total of 72 weekly downloads. As such, rekuire popularity was classified as not popular.
We found that rekuire demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.