Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-absolute-path

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-absolute-path

Absolute Path

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 15 Jun 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc