npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ee-core-lingyun

v1.0.4

Published

Enhanced ee-core with server management capabilities - stop, restart HTTP and Socket servers

Readme

EE-Core Enhanced

npm version License: MIT

Enhanced version of ee-core with advanced server management capabilities.

🚀 Features

  • Server Management: Stop, restart, and monitor HTTP and Socket.IO servers
  • Port Persistence: Servers maintain their original port numbers after restart
  • Graceful Shutdown: Properly close all connections and resources
  • Status Monitoring: Real-time server status tracking
  • Multiple Interfaces: HTTP API, Socket.IO, and direct function calls
  • IPC Fix: Resolved "Attempted to register a second handler" error
  • TypeScript Support: Full type definitions included
  • Error Handling: Comprehensive error handling and logging

📦 Installation

npm install ee-core-enhanced

🎯 Quick Start

const { ElectronEgg } = require('ee-core-enhanced');

// Initialize the application
const app = new ElectronEgg();
app.run();

🛠️ Server Management

HTTP API

# Get server status
GET http://localhost:7070/controller/serverManager/getStatus

# Stop all servers
POST http://localhost:7070/controller/serverManager/stopAll

# Restart all servers
POST http://localhost:7070/controller/serverManager/restartAll

# Individual server management
POST http://localhost:7070/controller/serverManager/stopHttp
POST http://localhost:7070/controller/serverManager/restartHttp
POST http://localhost:7070/controller/serverManager/stopSocket
POST http://localhost:7070/controller/serverManager/restartSocket

Socket.IO

const io = require('socket.io-client');
const socket = io('http://localhost:7071');

// Get server status
socket.emit('controller/serverManager/getStatus', {}, (response) => {
  console.log('Server status:', response);
});

// Restart all servers
socket.emit('controller/serverManager/restartAll', {}, (response) => {
  console.log('Restart result:', response);
});

Direct Function Calls

const { 
  stopAllServers,
  restartAllServers,
  getServersStatus 
} = require('ee-core-enhanced/socket');

// Get server status
const status = getServersStatus();
console.log('Servers status:', status);

// Stop all servers
const stopResult = await stopAllServers();
console.log('Stop result:', stopResult);

// Restart all servers
const restartResult = await restartAllServers();
console.log('Restart result:', restartResult);

📋 API Reference

Server Status Response

{
  "success": true,
  "data": {
    "httpServer": {
      "isRunning": true,
      "port": 7070,
      "host": "localhost",
      "protocol": "http://"
    },
    "socketServer": {
      "isRunning": true,
      "port": 7071,
      "channel": "controller"
    },
    "ipcServer": {
      "isRunning": true
    }
  }
}

Available Management Functions

| Function | Description | |----------|-------------| | stopAllServers() | Stop all servers | | restartAllServers() | Restart all servers | | stopHttpServer() | Stop HTTP server only | | restartHttpServer() | Restart HTTP server only | | stopSocketServer() | Stop Socket server only | | restartSocketServer() | Restart Socket server only | | getServersStatus() | Get all servers status |

🔧 Configuration

The server management respects all existing ee-core configurations. You can configure servers in your config files:

// config/config.default.js
module.exports = {
  httpServer: {
    enable: true,
    port: 7070,
    host: 'localhost',
    // ... other HTTP server options
  },
  socketServer: {
    enable: true,
    port: 7071,
    // ... other Socket server options
  }
};

🧪 Testing

Test the port persistence and restart functionality:

# Run the restart test script
node test-restart.js

This will verify that servers maintain their port numbers after restart.

📚 Documentation

For detailed documentation and examples, see:

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

This project is based on ee-core and extends it with server management capabilities.

📞 Support

If you have any questions or need help, please:

  1. Check the documentation
  2. Search existing issues
  3. Create a new issue if needed

Note: This is an enhanced version of ee-core. The main purpose is to add server restart and management capabilities while maintaining full compatibility with the original ee-core API.