Socket
Socket
Sign inDemoInstall

moog-require

Package Overview
Dependencies
Maintainers
12
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moog-require - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

15

index.js

@@ -44,2 +44,7 @@ var async = require('async');

var superDefine = self.define;
if (options.nestedModuleSubdirs) {
self._globCache = {};
}
self.define = function(type, definition, extending) {

@@ -60,3 +65,11 @@

if (options.nestedModuleSubdirs) {
var matches = glob.sync(self.options.localModules + '/**/' + type + '/index.js');
if (!self._indexes) {
// Fetching a list of index.js files on the first call and then searching it each time for
// one that refers to the right type name shaves as much as 60 seconds off the startup
// time in a large project, compared to using the glob cache feature
self._indexes = glob.sync(self.options.localModules + '/**/index.js');
}
var matches = self._indexes.filter(function(index) {
return index.endsWith('/' + type + '/index.js');
});
if (matches.length > 1) {

@@ -63,0 +76,0 @@ throw new Error('The module ' + type + ' appears in multiple locations:\n' + matches.join('\n'));

34

package.json
{
"name": "moog-require",
"version": "1.2.0",
"description": "moog-require extends moog with support for type definitions in local files and npm modules.",
"main": "index.js",
"author": {
"name": "Apostrophe Technologies"
},
"bugs": {
"url": "https://github.com/apostrophecms/moog-require/issues"
},
"bundleDependencies": false,
"dependencies": {

@@ -15,12 +18,8 @@ "async": "^1.0.0",

},
"deprecated": false,
"description": "moog-require extends moog with support for type definitions in local files and npm modules.",
"devDependencies": {
"mocha": "^5.0.0"
},
"scripts": {
"test": "mocha test/test.js"
},
"repository": {
"type": "git",
"url": "git://github.com/punkave/moog-require"
},
"homepage": "https://github.com/apostrophecms/moog-require#readme",
"keywords": [

@@ -33,4 +32,13 @@ "apostrophe",

],
"author": "P'unk Avenue",
"license": "MIT"
"license": "MIT",
"main": "index.js",
"name": "moog-require",
"repository": {
"type": "git",
"url": "git://github.com/apostrophecms/moog-require.git"
},
"scripts": {
"test": "mocha test/test.js"
},
"version": "1.3.0"
}

@@ -351,9 +351,11 @@ [![Build Status](https://travis-ci.org/punkave/moog-require.svg?branch=master)](https://travis-ci.org/punkave/moog-require)

**The 2.x series is deprecated for new work, as its functionality was folded into Apostrophe 3.x. See below for 1.x release notes relevant to maintenance of Apostrophe 2.x.**
1.3.0: achieved an approximately 100x performance improvement when `nestedModuleSubdirs` is in use by fetching
a list of index.js files on the first `define` call and then searching that prefetched list each
time. This solution is much faster than the glob module cache.
1.2.0: use `originalToMy` to handle moog class names with npm namespaces in them.
1.1.1: use `importFresh` to avoid bugs when two instances of `moog-require` are
loading the same module definitions. Previously if modules created by
the two instances later modified sub-properties of `options`, they would
inadvertently share values. This fix is critical for both `apostrophe-monitor`
and `apostrophe-multisite`.
1.1.1: use `importFresh` to avoid bugs when two instances of `moog-require` are loading the same module definitions. Previously if modules created by the two instances later modified sub-properties of `options`, they would inadvertently share values. This fix is critical for both `apostrophe-monitor` and `apostrophe-multisite`.

@@ -360,0 +362,0 @@ 1.1.0: support for the `nestedModuleSubdirs` option.

Sorry, the diff of this file is not supported yet

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