Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unlight/require-app-root
Hack for function `require` allows to load a module from the application root folder.
https://github.com/unlight/require-app-root
Last synced: 6 days ago
JSON representation
Hack for function `require` allows to load a module from the application root folder.
- Host: GitHub
- URL: https://github.com/unlight/require-app-root
- Owner: unlight
- Created: 2014-11-25T18:47:16.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-02T16:19:35.000Z (over 7 years ago)
- Last Synced: 2024-10-31T21:36:39.158Z (12 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
require-app-root
================# PROJECT ABANDONED. USE [requiro](https://www.npmjs.com/package/requiro) INSTEAD
Hack for function `require` allows to load a module from the application root folder,
using `~/` as in the asp.net's methods (LoadControl, etc.)INSTALLATION
------------
`npm install --save require-app-root`USAGE
-----
Somewhere in bootstrap file of your project:
```js
require("require-app-root");
```
Then you can use `require` with `~/`
```js
var user = require("~/library/user.js");
```NOTES
-----
It is enough to make `require("require-app-root")` once,
there is no need to insert it in each file of your application.