1.0.6 • Published 3 years ago

node-absolute-path v1.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

Node Absolute Path

This library can simplify the require paths in your node project. Instead of using relative paths like ../../../../controller/sample, you can write controller/sample. You won't need to calculate how many levels of directory you have to go up before accessing the file.

// Use this:
const sample = include('controller/sample');

// Instead of:
const sample = require('../../../../controller/sample');

Installation

Using npm:

$ npm install node-absolute-path --save

Example

require('node-absolute-path');
const express = include('express');
const bodyParser = include('body-parser');
const mongoose = include('mongoose');
const api = include('controller');
const app = express();

......
......
......

Browser Support

ChromeFirefoxSafariOperaEdgeIE
Latest ✔Latest ✔Latest ✔Latest ✔Latest ✔11 ✔

Contributing

GITHUB

MIT LICENSE