load-plugin 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -1
- package/package.json +7 -11
- package/readme.md +14 -6
package/index.js
CHANGED
|
@@ -47,6 +47,7 @@ function resolvePlugin(name, options) {
|
|
|
47
47
|
var settings = options || {}
|
|
48
48
|
var prefix = settings.prefix
|
|
49
49
|
var cwd = settings.cwd
|
|
50
|
+
var global = settings.global
|
|
50
51
|
var filePath
|
|
51
52
|
var sources
|
|
52
53
|
var length
|
|
@@ -55,6 +56,10 @@ function resolvePlugin(name, options) {
|
|
|
55
56
|
var slash
|
|
56
57
|
var scope = ''
|
|
57
58
|
|
|
59
|
+
if (global === null || global === undefined) {
|
|
60
|
+
global = globally
|
|
61
|
+
}
|
|
62
|
+
|
|
58
63
|
if (cwd && typeof cwd === 'object') {
|
|
59
64
|
sources = cwd.concat()
|
|
60
65
|
} else {
|
|
@@ -63,7 +68,7 @@ function resolvePlugin(name, options) {
|
|
|
63
68
|
|
|
64
69
|
// Non-path.
|
|
65
70
|
if (name.charAt(0) !== '.') {
|
|
66
|
-
if (
|
|
71
|
+
if (global) {
|
|
67
72
|
sources.push(globals)
|
|
68
73
|
}
|
|
69
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "load-plugin",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Load a submodule, plugin, or file",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
],
|
|
12
12
|
"repository": "wooorm/load-plugin",
|
|
13
13
|
"bugs": "https://github.com/wooorm/load-plugin/issues",
|
|
14
|
-
"author": "Titus Wormer <tituswormer@gmail.com> (
|
|
14
|
+
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
|
15
15
|
"contributors": [
|
|
16
|
-
"Titus Wormer <tituswormer@gmail.com> (
|
|
16
|
+
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
|
17
17
|
],
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"browser": "browser.js",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"npm-prefix": "^1.2.0",
|
|
26
|
-
"resolve-from": "^
|
|
26
|
+
"resolve-from": "^5.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"nyc": "^
|
|
29
|
+
"nyc": "^14.0.0",
|
|
30
30
|
"prettier": "^1.12.0",
|
|
31
31
|
"remark-cli": "^6.0.0",
|
|
32
32
|
"remark-lint": "^6.0.0",
|
|
33
33
|
"remark-preset-wooorm": "^4.0.0",
|
|
34
34
|
"tape": "^4.0.0",
|
|
35
|
-
"xo": "^0.
|
|
35
|
+
"xo": "^0.24.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
|
|
@@ -50,11 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"xo": {
|
|
52
52
|
"prettier": true,
|
|
53
|
-
"esnext": false
|
|
54
|
-
"rules": {
|
|
55
|
-
"no-eq-null": "off",
|
|
56
|
-
"eqeqeq": "off"
|
|
57
|
-
}
|
|
53
|
+
"esnext": false
|
|
58
54
|
},
|
|
59
55
|
"nyc": {
|
|
60
56
|
"check-coverage": true,
|
package/readme.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
# load-plugin
|
|
1
|
+
# load-plugin
|
|
2
|
+
|
|
3
|
+
[![Build][build-badge]][build]
|
|
4
|
+
[![Coverage][coverage-badge]][coverage]
|
|
5
|
+
[![Downloads][downloads-badge]][downloads]
|
|
2
6
|
|
|
3
7
|
Load a submodule, plugin, or file.
|
|
4
8
|
Like Node’s `require` and `require.resolve`, but from one or more places, and
|
|
@@ -91,19 +95,23 @@ found.
|
|
|
91
95
|
|
|
92
96
|
<!-- Definitions -->
|
|
93
97
|
|
|
94
|
-
[
|
|
98
|
+
[build-badge]: https://img.shields.io/travis/wooorm/load-plugin.svg
|
|
99
|
+
|
|
100
|
+
[build]: https://travis-ci.org/wooorm/load-plugin
|
|
101
|
+
|
|
102
|
+
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/load-plugin.svg
|
|
95
103
|
|
|
96
|
-
[
|
|
104
|
+
[coverage]: https://codecov.io/github/wooorm/load-plugin
|
|
97
105
|
|
|
98
|
-
[
|
|
106
|
+
[downloads-badge]: https://img.shields.io/npm/dm/load-plugin.svg
|
|
99
107
|
|
|
100
|
-
[
|
|
108
|
+
[downloads]: https://www.npmjs.com/package/load-plugin
|
|
101
109
|
|
|
102
110
|
[npm]: https://docs.npmjs.com/cli/install
|
|
103
111
|
|
|
104
112
|
[license]: license
|
|
105
113
|
|
|
106
|
-
[author]:
|
|
114
|
+
[author]: https://wooorm.com
|
|
107
115
|
|
|
108
116
|
[global]: https://docs.npmjs.com/files/folders#node-modules
|
|
109
117
|
|