Skip to content

Commit 6bbf353

Browse files
committed
converted wol to cjs, cleaned up actions
1 parent 72c4399 commit 6bbf353

File tree

13 files changed

+1114
-3851
lines changed

13 files changed

+1114
-3851
lines changed

.github/workflows/network-cidr-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ jobs:
4545
- name: Coveralls
4646
uses: coverallsapp/github-action@master
4747
with:
48-
path-to-lcov: ${{ github.workspace }}/packages/network-cidr/coverage/lcov.info
48+
path-to-lcov: packages/network-cidr/coverage/lcov.info
4949
github-token: ${{ secrets.ACCESS_TOKEN }}

.github/workflows/port-scanner-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ jobs:
4545
- name: Coveralls
4646
uses: coverallsapp/github-action@master
4747
with:
48-
path-to-lcov: ${{ github.workspace }}/packages/port-scanner/coverage/lcov.info
48+
path-to-lcov: packages/port-scanner/coverage/lcov.info
4949
github-token: ${{ secrets.ACCESS_TOKEN }}

.github/workflows/wol-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ jobs:
4545
- name: Coveralls
4646
uses: coverallsapp/github-action@master
4747
with:
48-
path-to-lcov: ${{ github.workspace }}/packages/wol/coverage/lcov.info
48+
path-to-lcov: packages/wol/coverage/lcov.info
4949
github-token: ${{ secrets.ACCESS_TOKEN }}

packages/port-scanner/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/port-scanner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mi-sec/port-scanner",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "simple port scanner utility",
55
"main": "./lib/port-scanner.js",
66
"exports": {

packages/wol/cjs/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/wol/cjs/wol.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/wol/esm/wol.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import mod from "../lib/wol.js";
2+
3+
export default mod;
4+
export const MAGIC_PACKET_MAC_COPIES = mod.MAGIC_PACKET_MAC_COPIES;
5+
export const createMagicPacket = mod.createMagicPacket;

packages/wol/lib/wol.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
*******************************************************************************************************/
66
'use strict';
77

8-
import dgram from 'dgram';
9-
import net from 'net';
8+
const
9+
dgram = require( 'dgram' ),
10+
net = require( 'net' );
1011

11-
import macAddress, { MAC_BYTES } from '@mi-sec/mac-address';
12+
const
13+
macAddress = require( '@mi-sec/mac-address' ),
14+
{ MAC_BYTES } = macAddress;
1215

13-
export const MAGIC_PACKET_MAC_COPIES = 16;
16+
const MAGIC_PACKET_MAC_COPIES = 16;
1417

15-
export function createMagicPacket( mac ) {
18+
function createMagicPacket( mac ) {
1619
mac = macAddress( mac );
1720

1821
const buf = Buffer.alloc( ( 1 + MAGIC_PACKET_MAC_COPIES ) * MAC_BYTES );
@@ -100,4 +103,6 @@ async function wakeOnLan( mac, opts = {} ) {
100103
};
101104
}
102105

103-
export default wakeOnLan;
106+
module.exports = wakeOnLan;
107+
module.exports.MAGIC_PACKET_MAC_COPIES = MAGIC_PACKET_MAC_COPIES;
108+
module.exports.createMagicPacket = createMagicPacket;

0 commit comments

Comments
 (0)