Socket
Socket
Sign inDemoInstall

module-alias

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-alias - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

11

index.js

@@ -8,2 +8,3 @@ 'use strict'

var moduleAliases = {}
var moduleAliasNames = [];

@@ -25,3 +26,4 @@ var oldNodeModulePaths = Module._nodeModulePaths

Module._resolveFilename = function (request, parent, isMain) {
for (var alias in moduleAliases) {
for (var i = moduleAliasNames.length; i-- > 0;) {
var alias = moduleAliasNames[i]
if (isPathMatchesAlias(request, alias)) {

@@ -32,2 +34,4 @@ request = nodePath.join(

)
// Only use the first match
break
}

@@ -92,2 +96,5 @@ }

moduleAliases[alias] = target
// Cost of sorting is lower here than during resolution
moduleAliasNames = Object.keys(moduleAliases)
moduleAliasNames.sort()
}

@@ -139,3 +146,3 @@

if (typeof npmPackage !== 'object') {
throw Error('Unable to read ' + base + '/package.json')
throw new Error('Unable to read ' + base + '/package.json')
}

@@ -142,0 +149,0 @@

2

package.json
{
"name": "module-alias",
"description": "Create aliases of directories and register custom module paths in NodeJS like a boss!",
"version": "2.0.0",
"version": "2.0.1",
"author": {

@@ -6,0 +6,0 @@ "name": "Nick Gavrilov",

@@ -30,3 +30,3 @@ # module-alias

**WARNING:** This module should not be used in other npm modules since it modifies the default `require` behavior! It is designed to be used for developing of projects such as web-sites, applications etc.
**WARNING:** This module should not be used in other npm modules since it modifies the default `require` behavior! It is designed to be used for development of final projects i.e. web-sites, applications etc.

@@ -33,0 +33,0 @@ ## Install

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