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

module-lookup-amd

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-lookup-amd

Resolve aliased dependency paths using a RequireJS config

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
734K
decreased by-26.38%
Maintainers
1
Weekly downloads
 
Created
Source

module-lookup-amd npm npm

This module basically exposes the requirejs config map and path resolution logic and gives you back the real, absolute, path of (possibly) aliased modules names.

I built this for Dependents' jump to dependency feature that lets you click on a module name and open the file that name resolves to.

npm install module-lookup-amd

Usage

var lookup = require('module-lookup-amd');

var realPath = lookup({
  config: 'path/to/my/requirejs/config', // optional
  partial: 'someModule',
  filename: 'file/containing/partial',
  directory: 'directory/containing/all/js/files'
});
  • config: the path to your RequireJS configuration file
  • partial: the (potentially aliased) dependency that you want to lookup
  • filename: the path of the file that contains the dependency (i.e., parent module)
  • directory: (Optional) the path to all files
    • Used as a last resort for resolving paths from files that are not within the config's base url (like test files that import a module)

Shell usage

Assumes a global -g installation

lookup-amd -c path/to/my/config.js -f path/to/file/containing/dependency -d path/containing/all/files my/dependency/name

Keywords

FAQs

Package last updated on 11 May 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