Skip to content
Snippets Groups Projects
Unverified Commit 38e0aba8 authored by Jason Mulligan's avatar Jason Mulligan
Browse files

Updating dev dependencies to remove audit warnings, updating README & LICENSE...

Updating dev dependencies to remove audit warnings, updating README & LICENSE copyright year, updating eslint rules, version bump to release new ESM support
parent d1924997
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,8 @@ ...@@ -5,11 +5,8 @@
"es6": true, "es6": true,
"amd": false "amd": false
}, },
"ecmaFeatures": { "parserOptions": {
"jsx": false, "ecmaVersion": 2018
"superInFunctions": false,
"classes": false,
"modules": [2]
}, },
"globals": { "globals": {
"self": true, "self": true,
......
...@@ -4,7 +4,7 @@ module.exports = function (grunt) { ...@@ -4,7 +4,7 @@ module.exports = function (grunt) {
babel: { babel: {
options: { options: {
sourceMap: false, sourceMap: false,
presets: ["babel-preset-es2015"] presets: ["babel-preset-env"]
}, },
dist: { dist: {
files: [{ files: [{
......
Copyright (c) 2017, Jason Mulligan Copyright (c) 2019, Jason Mulligan
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
......
...@@ -142,5 +142,5 @@ Returns true if successful. ...@@ -142,5 +142,5 @@ Returns true if successful.
* Unix/BSD will work with `SIGTERM`, but if you also need to support Windows use `SIGINT` * Unix/BSD will work with `SIGTERM`, but if you also need to support Windows use `SIGINT`
## License ## License
Copyright (c) 2017 Jason Mulligan Copyright (c) 2019 Jason Mulligan
Licensed under the BSD-3 license Licensed under the BSD-3 license
...@@ -98,7 +98,7 @@ var Worker = function () { ...@@ -98,7 +98,7 @@ var Worker = function () {
} }
}); });
this.child.send({ input: input, isfn: isfn, cwd: options.cwd }); this.child.send({ input: input, isfn: isfn, cwd: options.cwd, esm: options.esm });
} }
_createClass(Worker, [{ _createClass(Worker, [{
......
...@@ -15,7 +15,12 @@ function toFunction(arg) { ...@@ -15,7 +15,12 @@ function toFunction(arg) {
// Bootstraps the Worker // Bootstraps the Worker
process.once("message", function (obj) { process.once("message", function (obj) {
var exp = obj.isfn ? toFunction(obj.input) : fs.readFileSync(obj.input, "utf8"); var isfn = obj.isfn,
input = obj.input,
esm = obj.esm,
cwd = obj.cwd;
var exp = isfn ? toFunction(input) : esm ? "require(\"" + input + "\");" : fs.readFileSync(input, "utf8");
global.self = { global.self = {
close: function close() { close: function close() {
...@@ -35,9 +40,9 @@ process.once("message", function (obj) { ...@@ -35,9 +40,9 @@ process.once("message", function (obj) {
} }
}; };
global.__dirname = obj.cwd; global.__dirname = cwd;
global.__filename = __filename; global.__filename = __filename;
global.require = require; global.require = esm ? require("esm")(module) : require;
global.importScripts = function () { global.importScripts = function () {
for (var _len = arguments.length, files = Array(_len), _key = 0; _key < _len; _key++) { for (var _len = arguments.length, files = Array(_len), _key = 0; _key < _len; _key++) {
......
This diff is collapsed.
{ {
"name": "tiny-worker", "name": "tiny-worker",
"version": "2.1.2", "version": "2.2.0",
"description": "Tiny WebWorker for Server", "description": "Tiny WebWorker for Server",
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {
...@@ -23,13 +23,14 @@ ...@@ -23,13 +23,14 @@
}, },
"homepage": "https://github.com/avoidwork/tiny-worker", "homepage": "https://github.com/avoidwork/tiny-worker",
"devDependencies": { "devDependencies": {
"babel-preset-es2015": "~6.22.0", "babel-core": "^6.26.2",
"grunt": "~1.0.1", "babel-preset-env": "^1.7.0",
"grunt-babel": "~6.0.0", "grunt": "^1.0.4",
"grunt-cli": "~1.2.0", "grunt-babel": "^7.0.0",
"grunt-contrib-nodeunit": "~1.0.0", "grunt-cli": "^1.3.2",
"grunt-contrib-watch": "~1.0.0", "grunt-contrib-nodeunit": "^2.0.0",
"grunt-eslint": "~19.0.0" "grunt-contrib-watch": "^1.1.0",
"grunt-eslint": "^21.0.0"
}, },
"dependencies": { "dependencies": {
"esm": "^3.2.22" "esm": "^3.2.22"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment