
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
LunaHUB is the ultimate all-in-one JavaScript library for Node.js. HTTP client, Discord webhooks, TrueWallet API, utilities, and more - all in one package! π
npm install lunahub
const luna = require('lunahub');
// HTTP Request
const response = await luna.get('https://api.example.com/data');
// Discord Webhook
await luna.discord.sendWebhook('YOUR_WEBHOOK_URL', {
content: 'Hello from LunaHUB! π'
});
// TrueWallet
const result = await luna.truewallet.redeemVoucher('VOUCHER_LINK', '0812345678');
// Utilities
await luna.utils.sleep(1000);
console.log(luna.utils.randomString(16));
const luna = require('lunahub');
// GET request
const data = await luna.get('https://api.example.com/users');
// POST request
const result = await luna.post('https://api.example.com/users', {
name: 'John Doe',
email: 'john@example.com'
});
// PUT request
await luna.put('https://api.example.com/users/1', { name: 'Jane' });
// DELETE request
await luna.delete('https://api.example.com/users/1');
// Custom configuration
const response = await luna.request({
method: 'POST',
url: 'https://api.example.com/data',
headers: {
'Authorization': 'Bearer TOKEN',
'Content-Type': 'application/json'
},
data: { key: 'value' },
timeout: 5000
});
// Create custom instance with options
const customLuna = luna.create({
timeout: 10000,
maxRetries: 5,
debug: true
});
await luna.discord.sendWebhook('YOUR_WEBHOOK_URL', {
content: 'Hello Discord! π',
username: 'LunaBot',
avatarUrl: 'https://example.com/avatar.png'
});
const embed = luna.discord.createEmbed({
title: 'π New Update!',
description: 'LunaHUB v2.0 is now available!',
color: luna.discord.colors.DISCORD,
fields: [
{ name: 'π¦ Version', value: '2.0.0', inline: true },
{ name: 'π
Date', value: '2024-11-23', inline: true }
],
thumbnail: 'https://example.com/logo.png',
footer: 'Powered by LunaHUB',
timestamp: true
});
await luna.discord.sendEmbed('YOUR_WEBHOOK_URL', embed);
const embed1 = luna.discord.createEmbed({
title: 'First Embed',
color: luna.discord.colors.GREEN
});
const embed2 = luna.discord.createEmbed({
title: 'Second Embed',
color: luna.discord.colors.BLUE
});
await luna.discord.sendWebhook('YOUR_WEBHOOK_URL', {
content: 'Check out these embeds!',
embeds: [embed1, embed2]
});
luna.discord.colors = {
RED: 0xFF0000,
GREEN: 0x00FF00,
BLUE: 0x0000FF,
YELLOW: 0xFFFF00,
PURPLE: 0x800080,
ORANGE: 0xFFA500,
DISCORD: 0x5865F2,
SUCCESS: 0x00FF00,
ERROR: 0xFF0000,
WARNING: 0xFFFF00,
INFO: 0x0099FF
}
const result = await luna.truewallet.redeemVoucher(
'https://gift.truemoney.com/campaign/?v=xxxxx',
'0812345678'
);
if (result.status.code === 'SUCCESS') {
console.log(`β
Received ${result.data.amount} THB`);
} else {
console.log(`β Error: ${result.status.message}`);
}
const vouchers = [
'https://gift.truemoney.com/campaign/?v=xxxxx1',
'https://gift.truemoney.com/campaign/?v=xxxxx2',
'https://gift.truemoney.com/campaign/?v=xxxxx3'
];
for (const voucher of vouchers) {
const result = await luna.truewallet.redeemVoucher(voucher, '0812345678');
console.log(result);
await luna.utils.sleep(1000); // Wait 1 second between requests
}
await luna.utils.sleep(1000); // Sleep for 1 second
await luna.utils.sleep(5000); // Sleep for 5 seconds
const num = luna.utils.random(1, 100); // Random number between 1-100
console.log(num);
const token = luna.utils.randomString(32); // Random 32-char string
const code = luna.utils.randomString(8); // Random 8-char string
console.log(luna.utils.formatNumber(1234567)); // "1,234,567"
console.log(luna.utils.formatNumber(999999)); // "999,999"
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const chunks = luna.utils.chunk(numbers, 3);
// [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
const data = luna.utils.parseJSON('{"name":"John"}'); // Returns object
const invalid = luna.utils.parseJSON('invalid json', {}); // Returns {}
const now = luna.utils.timestamp(); // Unix timestamp (seconds)
const formatted = luna.utils.formatDate(); // "2024-11-23 14:30:00"
const custom = luna.utils.formatDate(new Date(), 'YYYY/MM/DD'); // "2024/11/23"
const encoded = luna.crypto.base64Encode('Hello World');
console.log(encoded); // "SGVsbG8gV29ybGQ="
const decoded = luna.crypto.base64Decode(encoded);
console.log(decoded); // "Hello World"
const token = luna.crypto.generateToken(); // 64-char hex token
const shortToken = luna.crypto.generateToken(16); // 32-char hex token
// Get all posts
const posts = await luna.api.jsonPlaceholder.getPosts();
// Get single post
const post = await luna.api.jsonPlaceholder.getPost(1);
// Create post
const newPost = await luna.api.jsonPlaceholder.createPost({
title: 'My Post',
body: 'Post content',
userId: 1
});
const user = await luna.api.randomUser();
console.log(user.name.first, user.name.last);
console.log(user.email);
console.log(user.picture.large);
const fact = await luna.api.catFact();
console.log(`π± ${fact}`);
const dogUrl = await luna.api.randomDog();
console.log(`πΆ ${dogUrl}`);
const luna = require('lunahub');
async function sendAlert(webhookUrl) {
// Create embed
const embed = luna.discord.createEmbed({
title: 'π¨ System Alert',
description: 'Server is running smoothly',
color: luna.discord.colors.SUCCESS,
fields: [
{ name: 'Status', value: 'β
Online', inline: true },
{ name: 'Uptime', value: '24h', inline: true },
{ name: 'CPU', value: '45%', inline: true },
{ name: 'Memory', value: '2.4 GB', inline: true }
],
footer: 'Powered by LunaHUB',
timestamp: true
});
// Send to Discord
await luna.discord.sendEmbed(webhookUrl, embed, {
username: 'Server Monitor',
avatarUrl: 'https://example.com/bot.png'
});
console.log('β
Alert sent to Discord!');
}
sendAlert('YOUR_WEBHOOK_URL');
const luna = require('lunahub');
async function redeemAndNotify(voucherLink, phoneNumber, webhookUrl) {
// Redeem voucher
const result = await luna.truewallet.redeemVoucher(voucherLink, phoneNumber);
// Create embed based on result
const embed = luna.discord.createEmbed({
title: result.status.code === 'SUCCESS' ? 'β
Voucher Redeemed!' : 'β Redeem Failed',
description: result.status.message,
color: result.status.code === 'SUCCESS'
? luna.discord.colors.SUCCESS
: luna.discord.colors.ERROR,
fields: result.data ? [
{ name: 'π° Amount', value: `${result.data.amount} THB`, inline: true },
{ name: 'π± Phone', value: phoneNumber, inline: true }
] : [],
timestamp: true
});
// Send to Discord
await luna.discord.sendEmbed(webhookUrl, embed);
return result;
}
redeemAndNotify(
'https://gift.truemoney.com/campaign/?v=xxxxx',
'0812345678',
'YOUR_WEBHOOK_URL'
);
luna.request(config) - Make HTTP requestluna.get(url, config) - GET requestluna.post(url, data, config) - POST requestluna.put(url, data, config) - PUT requestluna.delete(url, config) - DELETE requestluna.discord.sendWebhook(url, options) - Send messageluna.discord.createEmbed(options) - Create embedluna.discord.sendEmbed(url, embed, options) - Send embedluna.discord.colors - Color presetsluna.truewallet.redeemVoucher(link, phone) - Redeem voucherluna.utils.sleep(ms) - Delayluna.utils.random(min, max) - Random numberluna.utils.randomString(length) - Random stringluna.utils.formatNumber(num) - Format numberluna.utils.chunk(array, size) - Split arrayluna.utils.parseJSON(str, fallback) - Parse JSONluna.utils.timestamp() - Unix timestampluna.utils.formatDate(date, format) - Format dateluna.crypto.base64Encode(str) - Encode base64luna.crypto.base64Decode(str) - Decode base64luna.crypto.generateToken(length) - Generate tokenluna.api.jsonPlaceholder.* - Test APIluna.api.randomUser() - Random user dataluna.api.catFact() - Cat factluna.api.randomDog() - Dog imageaxios - HTTP clientContributions, issues, and feature requests are welcome!
MIT Β© LunaHUB Team
Made with π by LunaHUB Team
FAQs
π LunaHUB - Ultimate All-in-One JavaScript Library
We found that lunahub demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.