Skip to content

Commit 38e0aba

Browse files
committed
Updating dev dependencies to remove audit warnings, updating README & LICENSE copyright year, updating eslint rules, version bump to release new ESM support
1 parent d192499 commit 38e0aba

File tree

8 files changed

+3783
-2393
lines changed

8 files changed

+3783
-2393
lines changed

.eslintrc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
"es6": true,
66
"amd": false
77
},
8-
"ecmaFeatures": {
9-
"jsx": false,
10-
"superInFunctions": false,
11-
"classes": false,
12-
"modules": [2]
8+
"parserOptions": {
9+
"ecmaVersion": 2018
1310
},
1411
"globals": {
1512
"self": true,

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = function (grunt) {
44
babel: {
55
options: {
66
sourceMap: false,
7-
presets: ["babel-preset-es2015"]
7+
presets: ["babel-preset-env"]
88
},
99
dist: {
1010
files: [{

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017, Jason Mulligan
1+
Copyright (c) 2019, Jason Mulligan
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,5 @@ Returns true if successful.
142142
* Unix/BSD will work with `SIGTERM`, but if you also need to support Windows use `SIGINT`
143143

144144
## License
145-
Copyright (c) 2017 Jason Mulligan
145+
Copyright (c) 2019 Jason Mulligan
146146
Licensed under the BSD-3 license

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ var Worker = function () {
9898
}
9999
});
100100

101-
this.child.send({ input: input, isfn: isfn, cwd: options.cwd });
101+
this.child.send({ input: input, isfn: isfn, cwd: options.cwd, esm: options.esm });
102102
}
103103

104104
_createClass(Worker, [{

lib/worker.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ function toFunction(arg) {
1515

1616
// Bootstraps the Worker
1717
process.once("message", function (obj) {
18-
var exp = obj.isfn ? toFunction(obj.input) : fs.readFileSync(obj.input, "utf8");
18+
var isfn = obj.isfn,
19+
input = obj.input,
20+
esm = obj.esm,
21+
cwd = obj.cwd;
22+
23+
var exp = isfn ? toFunction(input) : esm ? "require(\"" + input + "\");" : fs.readFileSync(input, "utf8");
1924

2025
global.self = {
2126
close: function close() {
@@ -35,9 +40,9 @@ process.once("message", function (obj) {
3540
}
3641
};
3742

38-
global.__dirname = obj.cwd;
43+
global.__dirname = cwd;
3944
global.__filename = __filename;
40-
global.require = require;
45+
global.require = esm ? require("esm")(module) : require;
4146

4247
global.importScripts = function () {
4348
for (var _len = arguments.length, files = Array(_len), _key = 0; _key < _len; _key++) {

0 commit comments

Comments
 (0)