Generated TypeScript SDK client for https://github.com/nekomeowww/factorio-rcon-api
npm install factorio-rcon-api-clientfactorio-rcon-api-clientGenerated TypeScript SDK client for https://github.com/nekomeowww/factorio-rcon-api
``shellnpm i -g @antfu/ni
ni factorio-rcon-api-client # from @antfu/ni, can be installed via `
pnpm i factorio-rcon-api-client
yarn i factorio-rcon-api-client
npm i factorio-rcon-api-client
`ts
// Import the client and the API functions
import { client, v2FactorioConsoleCommandRawPost } from 'factorio-rcon-api-client'
async function main() {
// Set the base URL of the API
client.setConfig({
baseUrl: 'http://localhost:3000',
})
// Call POST /api/v2/factorio/console/command/raw
const res = await v2FactorioConsoleCommandRawPost({
body: {
input: '/help', // The command to run
},
})
console.log(res) // The response from the API
}
main().catch(console.error)
``