
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Utility for managing a Minecraft server running on Google Cloud Compute. Automatically shuts down server after 10 minutes of inactivity.
See mcm-server for a more useful and higher level implementation.
npm install --save mcm
You also need to download Google Application credentials and set the GOOGLE_APPLICATION_CREDENTIALS
environment variable to the json filepath unless you have authenticated via another method.
import mcm from 'mcm';
let minecraftOptions = {
host: 'localhost',
port: '25565'
};
let googleComputeOptions = {
project: 'random-name-34834',
zone: 'us-central1-a',
instance: 'minecraft-instance'
};
const mcServer = mcm(minecraftOptions, googleComputeOptions);
mcServer.getStatus((err, stat) => {
if (!err) {
// server already started!
}
else {
// server not started!
mcServer.start((err) => {
if (!err) {
// server started!
// will shutdown automatically after 10 minutes of inactivity
}
})
}
});
const mcServer = mcm([minecraftOptions], [googleComputeOptions]);
minecraftOptions
Object:
host
- Minecraft server hostport
- Minecraft server portgoogleComputeOptions
Object:
project
- Google Cloud project namezone
- Google Cloud zone where instance residesinstance
- Google Cloud Compute instance nameminecraftOptions
defaults to:
{ host: process.env.MC_SERVER || 'localhost',
port: process.env.MC_PORT || 25565 }
googleComputeOptions
defaults to:
{ project: process.env.GC_PROJECT,
zone: process.env.GC_ZONE,
instance: process.env.GC_INSTANCE }
Starts the Google Compute instance.
If present, the callback will be called with any potential errors.
Stops the Google Compute intance.
If present, the callback will be called with any potential errors.
Called on 'empty'
.
Gets the status of the Minecraft server.
Callback should take two arguments, err
and status
.
status
will contain an object that looks similar to:
{ protocol_version: '51',
minecraft_version: '1.4.7',
server_name: 'Your Server MOTD',
num_players: 0,
max_players: 20 }
Start monitoring. This will ping the server every 5 minutes. After two pings in which the server is empty, it will emit 'empty'
.
Called on 'start'
.
Emitted after the server is successfully started.
Emitted after the server is successfully stopped.
Emitted when the server has no players after 10 minutes.
FAQs
Automatically start up and shut down a minecraft server.
The npm package mcm receives a total of 0 weekly downloads. As such, mcm popularity was classified as not popular.
We found that mcm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.