
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.
jsonfixerai
Advanced tools
Official SDK for the JsonFixer API — AI-powered JSON repair, validation, and schema conversion.
Official SDK for the JsonFixer API — AI-powered JSON repair, validation, and schema conversion in one npm install.
Drop it between your LLM call and your JSON.parse(). Every broken response gets fixed before it reaches your application logic — deterministically, in under 200 ms.
npm install jsonfixer
import { fix } from 'jsonfixer';
// Broken LLM output → repaired JSON
const result = await fix('{"name": "Alice", age: 30}', {
apiKey: 'jf_your_key_here',
});
const parsed = JSON.parse(result.result);
console.log(parsed); // { name: 'Alice', age: 30 }
console.log(result.stage); // 'wasm' | 'jsonrepair' | 'ai' | 'ai-retry'
Get your API key at jsonfixer.ai/dashboard/developer.
# npm
npm install jsonfixer
# pnpm
pnpm add jsonfixer
# yarn
yarn add jsonfixer
# Deno (import from npm)
import { fix } from 'npm:jsonfixer';
No TypeScript required — works with plain Node.js:
// CommonJS (Node.js)
const { fix } = require('jsonfixer');
fix('{"name": "Alice", age: 30}', { apiKey: 'jf_your_key_here' })
.then(result => console.log(JSON.parse(result.result)))
.catch(err => console.error(err.message));
// ESM (Node.js 18+, Deno, browser bundler)
import { fix } from 'jsonfixer';
const result = await fix('{"name": "Alice", age: 30}', {
apiKey: 'jf_your_key_here',
});
console.log(JSON.parse(result.result)); // { name: 'Alice', age: 30 }
fix()The quickest way — pass the broken JSON and your API key:
import { fix } from 'jsonfixer';
const result = await fix(brokenJson, { apiKey: 'jf_...' });
const data = JSON.parse(result.result);
JsonFixerConfigure once, reuse across your application:
import JsonFixer from 'jsonfixer';
const client = new JsonFixer({
apiKey: process.env.JSONFIXER_API_KEY!,
strategy: 'standard', // default
timeoutMs: 30_000, // default
});
// Repair raw LLM output
const result = await client.fix(llmResponse);
const parsed = JSON.parse(result.result);
import OpenAI from 'openai';
import { fix, JsonFixerError } from 'jsonfixer';
const openai = new OpenAI();
const client = new (await import('jsonfixer')).default({
apiKey: process.env.JSONFIXER_API_KEY!,
});
const chat = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Return a JSON object with name and age' }],
});
const raw = chat.choices[0].message.content ?? '';
try {
const fixed = await client.fix(raw);
const data = JSON.parse(fixed.result);
console.log('Parsed safely:', data);
} catch (err) {
if (err instanceof JsonFixerError) {
console.error('Repair failed:', err.message, '(status:', err.status, ')');
}
}
import { fix } from 'npm:jsonfixer';
const raw = await Deno.readTextFile('./config.json');
const result = await fix(raw, {
apiKey: Deno.env.get('JSONFIXER_API_KEY')!,
});
const config = JSON.parse(result.result);
console.log('Loaded config via stage:', result.stage);
import { fix } from 'jsonfixer';
async function validateInput(userInput: string) {
try {
const result = await fix(userInput, {
apiKey: import.meta.env.VITE_JSONFIXER_API_KEY,
timeoutMs: 10_000,
});
return JSON.parse(result.result);
} catch {
return null; // invalid and unrepairable
}
}
const result = await fix(badLlmJson, {
apiKey: 'jf_...',
strategy: 'recursive', // deeper, slower — best for severely broken input
});
const result = await fix('{"name": "Alice", "age": 30}', {
apiKey: 'jf_...',
schemaTarget: 'typescript', // 'typescript' | 'zod' | 'pydantic' | 'go'
});
console.log(result.result);
// interface Root {
// name: string;
// age: number;
// }
fix(json, options)function fix(json: string, options: FixOptions): Promise<FixResult>
| Parameter | Type | Required | Description |
|---|---|---|---|
json | string | ✓ | The malformed JSON string to repair |
options.apiKey | string | ✓ | Your jf_ prefixed API key |
options.strategy | 'standard' | 'recursive' | — | Repair depth. Default: 'standard' |
options.schemaTarget | 'typescript' | 'zod' | 'pydantic' | 'go' | — | Return a schema instead of JSON |
options.timeoutMs | number | — | Request timeout ms. Default: 30000 |
options.baseUrl | string | — | Override API URL. Default: https://jsonfixer.ai |
new JsonFixer(options)const client = new JsonFixer(options: JsonFixerOptions);
await client.fix(json: string, overrides?: Omit<FixOptions, 'apiKey'>): Promise<FixResult>
| Option | Type | Required | Description |
|---|---|---|---|
apiKey | string | ✓ | Your jf_ prefixed API key |
strategy | 'standard' | 'recursive' | — | Default strategy for this instance |
timeoutMs | number | — | Default timeout for this instance |
baseUrl | string | — | Override base URL |
FixResultinterface FixResult {
success: true;
result: string; // Repaired JSON — pass to JSON.parse()
stage: RepairStage; // 'wasm' | 'jsonrepair' | 'ai' | 'ai-retry'
inputLength: number; // Input size in bytes
outputLength: number; // Output size in bytes
}
JsonFixerErrorThrown on any API error, network failure, or timeout.
class JsonFixerError extends Error {
status: number; // HTTP status, or 0 for network/timeout errors
code: string | undefined; // Short error code: 'TIMEOUT', 'NETWORK_ERROR', 'MISSING_API_KEY', etc.
}
JsonFixer runs your input through up to four increasingly powerful repair stages:
| Stage | Technology | Speed | Use case |
|---|---|---|---|
wasm | Custom WASM heuristics | ~5 ms | 90% of real-world cases |
jsonrepair | jsonrepair | ~10 ms | Structural issues |
ai | AI | ~150 ms | Complex/ambiguous malformation |
ai-retry | AI (second pass) | ~300 ms | Last resort |
The SDK returns the stage field so you can track which stage fired in your metrics.
import { fix, JsonFixerError } from 'jsonfixer';
try {
const result = await fix(badJson, { apiKey: 'jf_...' });
return JSON.parse(result.result);
} catch (err) {
if (err instanceof JsonFixerError) {
switch (err.code) {
case 'TIMEOUT':
console.error('Request timed out');
break;
case 'NETWORK_ERROR':
console.error('Could not reach the API');
break;
default:
console.error(`API error ${err.status}: ${err.message}`);
}
}
throw err;
}
| Plan | Price | AI repairs | File size | API calls |
|---|---|---|---|---|
| Free trial | $0 | 1 lifetime | 50 KB | — |
| Pay-per-call | $0.002 / req | Unlimited | 5 MB | Unlimited |
| Pro | $12 / mo | 500 / month | 5 MB | 1,000 / day |
| Team | $199 / mo | Unlimited | 50 MB | 50,000 / month |
All plans include the full four-stage self-healing pipeline.
Get your API key → jsonfixer.ai/dashboard/developer
This package is ready to publish. Run:
cd packages/jsonfixer-sdk
npm install
npm run build
npm publish --access public
Make sure you're logged into npm (
npm login) and own thejsonfixerpackage name.
MIT © JsonFixer
FAQs
Official SDK for the JsonFixer API — AI-powered JSON repair, validation, and schema conversion.
We found that jsonfixerai 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.