Skip to content

Commit

Permalink
converted wol to cjs, cleaned up actions
Browse files Browse the repository at this point in the history
  • Loading branch information
iSkore committed May 15, 2020
1 parent 72c4399 commit 6bbf353
Show file tree
Hide file tree
Showing 13 changed files with 1,114 additions and 3,851 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/network-cidr-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
- name: Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: ${{ github.workspace }}/packages/network-cidr/coverage/lcov.info
path-to-lcov: packages/network-cidr/coverage/lcov.info
github-token: ${{ secrets.ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/port-scanner-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
- name: Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: ${{ github.workspace }}/packages/port-scanner/coverage/lcov.info
path-to-lcov: packages/port-scanner/coverage/lcov.info
github-token: ${{ secrets.ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/wol-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
- name: Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: ${{ github.workspace }}/packages/wol/coverage/lcov.info
path-to-lcov: packages/wol/coverage/lcov.info
github-token: ${{ secrets.ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion packages/port-scanner/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/port-scanner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mi-sec/port-scanner",
"version": "1.0.1",
"version": "1.0.2",
"description": "simple port scanner utility",
"main": "./lib/port-scanner.js",
"exports": {
Expand Down
3 changes: 0 additions & 3 deletions packages/wol/cjs/package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/wol/cjs/wol.js

This file was deleted.

5 changes: 5 additions & 0 deletions packages/wol/esm/wol.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import mod from "../lib/wol.js";

export default mod;
export const MAGIC_PACKET_MAC_COPIES = mod.MAGIC_PACKET_MAC_COPIES;
export const createMagicPacket = mod.createMagicPacket;
17 changes: 11 additions & 6 deletions packages/wol/lib/wol.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
*******************************************************************************************************/
'use strict';

import dgram from 'dgram';
import net from 'net';
const
dgram = require( 'dgram' ),
net = require( 'net' );

import macAddress, { MAC_BYTES } from '@mi-sec/mac-address';
const
macAddress = require( '@mi-sec/mac-address' ),
{ MAC_BYTES } = macAddress;

export const MAGIC_PACKET_MAC_COPIES = 16;
const MAGIC_PACKET_MAC_COPIES = 16;

export function createMagicPacket( mac ) {
function createMagicPacket( mac ) {
mac = macAddress( mac );

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

export default wakeOnLan;
module.exports = wakeOnLan;
module.exports.MAGIC_PACKET_MAC_COPIES = MAGIC_PACKET_MAC_COPIES;
module.exports.createMagicPacket = createMagicPacket;
Loading

0 comments on commit 6bbf353

Please sign in to comment.