New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

warp.firstclass

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

warp.firstclass

Allows to access all your modules directly like: require('moduleName') by creating symlinks

  • 0.0.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

Overview

Makes your node modules first class, so:

// no more:
require('../../../awesomeModule') 
// just:
require('awesomeModule').

How

It creates symlinks in ./node_modules for all the root directories in provided 'dirToLink' directory. Works on Mac, Linux and Windows.

Usage

Say you have project structure like

  • server.js
  • package.json
  • backend
    • models

    • config

    • controllers

This would allow to require any modules in './backend' directory directly.

npm install warp.firstclass
warp.firstclass './backend/'
    

Now if you somewhere deep below in you controllers, you can still do:

var db = require('models'); //instead of require('../../../models')

Execute automatically with npm install

add the following to package.json

scripts": { "preinstall": "warp.firstclass './backend/'"}

Troubleshooting

  1. You get error " -bash: warp.firstclass: command not found "

    node node_modules/warp.firstclass/bin/warp.firstclass.js './backend/'

  2. If you get permissions errors when running npm install you might need to run it as a root user (admin). so:

Linux/Mac

sudo npm install --unsafe-perm

The --unsafe-perm option insures that it actually gets runned as root, because when you run npm install as a root NPM tries to downgrade its privileges.

Windows

  • open terminal as administrator
  • run

Keywords

FAQs

Package last updated on 29 Sep 2016

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