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

dont-look-up

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dont-look-up

Stop requirejs from traversing at a certain point

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

don't look up

NPM

Stop requirejs from traversing at a certain point

Whatever you do — don't look up

Stop requirejs' search path from looking higher than a given directory. This behaviour is should prevent your application from finding modules installed globally, or on a higher level directory, like in a mono-repo containing many packages.

describe('my-tests', () => {
    require('dont-look-up')(__dirname);

    it('should not traverse beyond this directory', () => { ... });
});

Example

Consider the following tree

└── repository
    ├── package
    │   ├── index.js
    │   ├── package.json
    │   └── node_modules
    │       └── child-level-module
    └── node_modules
        └── parent-level-module
package/index.js
require('parent-level-module'); // works
require('child-level-module'); // works

With "don't look up"

require('dont-look-up')(__dirname);
require('parent-level-module'); // throws error
require('child-level-module'); // works

FAQs

Package last updated on 14 Mar 2018

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