
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
This repository hosts the official SDK for interacting with the Luraph API from Node.js environments.
Luraph API access is only available for accounts under certain plans. For more information, please check out the pricing plans on the Luraph website.
Install the luraph package from npm using your package manager of choice.
Example:
npm install luraph
# or
yarn add luraph
# or
pnpm install luraph
The official Luraph API documentation contains the most up-to-date and complete information and instructions for integrating with the Luraph API.
const { Luraph } = require("luraph");
const apiKey = process.env.LPH_API_KEY; //replace with your api key
const luraph = new Luraph(apiKey);
const obfuscate = async (script, fileName) => {
console.log(`[*] file name: ${fileName}`);
const nodes = await luraph.getNodes();
console.log(`[*] recommended node: ${nodes.recommendedId}`);
const node = nodes.nodes[nodes.recommendedId];
console.log(`[*] cpu usage: ${node.cpuUsage}`);
const { jobId } = await luraph.createNewJob(nodes.recommendedId, script, fileName, {});
console.log(`[*] job id: ${jobId}`);
const { success, error } = await luraph.getJobStatus(jobId);
console.log(`[*] job status: ${success ? "success" : "error"}`);
if(success){
const {fileName: resultName, data} = await luraph.downloadResult(jobId);
console.log(`[*] result name: ${resultName}`);
return data;
}else{
throw error; //error is a string
}
};
obfuscate("print'Hello World!'", `luraph-node-${Date.now()}.lua`)
.then(result => console.log(`[*] obfuscation successful: ${result.split("\n")[0]}`))
.catch(error => console.error(`[*] obfuscation failed: ${error}`));
const { Luraph } = require("luraph");
const apiKey = process.env.LPH_API_KEY; //replace with your api key
const luraph = new Luraph(apiKey);
const listOptions = async () => {
const nodes = await luraph.getNodes();
console.log(`[*] recommended node: ${nodes.recommendedId}`);
const node = nodes.nodes[nodes.recommendedId];
console.log(`[*] cpu usage: ${node.cpuUsage}`);
console.log("[*] options:");
for(const [optionId, optionInfo] of Object.entries(node.options)){
console.log(" *", optionId, "-", optionInfo.name + ":");
console.log(" |- desc:", optionInfo.description);
console.log(" |- type:", optionInfo.type);
console.log(" |- tier:", optionInfo.tier);
console.log(" |- choices:", `[${optionInfo.choices.join(", ")}]`);
console.log(" |- required:", optionInfo.required);
if(optionInfo.dependencies) console.log(" |- dependencies: ", optionInfo.dependencies);
}
};
listOptions();
const { Luraph } = require("luraph");
const apiKey = process.env.LPH_API_KEY; //replace with your api key
const luraph = new Luraph(apiKey);
const obfuscate = async (script, fileName) => {
console.log(`[*] file name: ${fileName}`);
const nodes = await luraph.getNodes();
console.log(`[*] recommended node: ${nodes.recommendedId}`);
const node = nodes.nodes[nodes.recommendedId];
console.log(`[*] cpu usage: ${node.cpuUsage}`);
const { jobId } = await luraph.createNewJob(nodes.recommendedId, script, fileName, {
"TARGET_VERSION": "Lua 5.2"
});
console.log(`[*] job id: ${jobId}`);
const { success, error } = await luraph.getJobStatus(jobId);
console.log(`[*] job status: ${success ? "success" : "error"}`);
if(success){
const {fileName: resultName, data} = await luraph.downloadResult(jobId);
console.log(`[*] result name: ${resultName}`);
return data;
}else{
throw error; //error is a string
}
};
obfuscate("print'Hello World!'", `luraph-node-${Date.now()}.lua`)
.then(result => console.log(`[*] obfuscation successful: ${result.split("\n")[0]}`))
.catch(error => console.error(`[*] obfuscation failed: ${error}`));
The official Luraph API documentation contains the most up-to-date and complete information and instructions for integrating with the Luraph API.
Description: Creates an instance of the SDK.
Parameters:
Returns: An instance of the Luraph class allowing API requests to be made.
Description: Obtains a list of available obfuscation nodes.
Parameters: None!
Returns: <object>
Description: Queues a new obfuscation task.
Parameters:
enforceSettings
is set to false, all options supported by the node must have a value specified, else the endpoint will error.options
field to require every option requested by the server to be present with a valid value. If this is false, your integration will not break when invalid options are provided; however, updates that change Luraph's options will result in your integration using default settings when invalid values are specified. By default, this is set to true
.Returns: <object>
Description: This endpoint does not return until the referenced obfuscation job is complete. The maximum timeout is 60 seconds, and this endpoint can be called a maximum of 3 times per job.
Parameters:
Returns: <object>
Description: Downloads the resulting file associated with an obfuscation job.
Parameters:
Returns: <object>
Fields:
CUSTOMER_ONLY
, PREMIUM_ONLY
, ADMIN_ONLY
.CHECKBOX
, DROPDOWN
, TEXT
.true
for this field should be explicitly set by the user, since they have a high chance of causing incorrect output when not set properly.type == DROPDOWN
.Fields:
LuraphOptionInfo
as values.An array of string keys, and values that may either be a string or boolean.
Fields:
Fields:
LuraphError
.FAQs
Luraph API binding for Node.JS
The npm package luraph receives a total of 33 weekly downloads. As such, luraph popularity was classified as not popular.
We found that luraph 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.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.