
Product
Socket Now Protects the Firefox Extension Ecosystem
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.
@ailang/parse
Advanced tools
JavaScript/TypeScript client for the AILANG Parse document parsing API. Parse 13 formats, generate 8 — zero dependencies, native fetch.
npm install @ailang/parse
import { DocParse } from '@ailang/parse'
const client = new DocParse({ apiKey: 'dp_your_key_here' });
// Parse a document
const result = await client.parse('report.docx');
console.log(`${result.blocks.length} blocks, format: ${result.format}`);
for (const block of result.blocks) {
switch (block.type) {
case 'heading':
console.log(` H${block.level}: ${block.text}`);
break;
case 'table':
console.log(` Table: ${block.headers?.length} cols, ${block.rows?.length} rows`);
break;
case 'change':
console.log(` ${block.changeType} by ${block.author}: ${block.text}`);
break;
default:
console.log(` ${block.type}: ${block.text?.slice(0, 80)}`);
}
}
// Parse with different output formats
const blocks = await client.parse('report.docx'); // Block ADT (default)
const markdown = await client.parse('report.docx', 'markdown'); // Markdown
const html = await client.parse('report.docx', 'html'); // HTML
// Access structured data
console.log(result.status); // "success"
console.log(result.blocks); // Block[]
console.log(result.metadata.title); // Document title
console.log(result.summary.tables); // Number of tables
All 9 block types are fully typed:
import type { Block, Cell, ParseResult } from '@ailang/parse'
// Type narrowing via block.type
for (const block of result.blocks) {
if (block.type === 'section') {
console.log(`Section: ${block.kind}`); // "slide", "header", etc.
for (const child of block.blocks ?? []) {
console.log(` ${child.type}: ${child.text}`);
}
}
}
Key generation uses the device auth flow (v0.10.0+). Direct generation is no longer available.
// Get a key via device auth flow:
// 1. POST /api/v1/auth/device → {device_code, user_code, verification_url}
// 2. User opens verification_url, signs in, clicks Approve
// 3. POST /api/v1/auth/device/poll → {api_key, tier}
// Usage
const usage = await client.keys.usage('keyId123', 'user123');
console.log(`${usage.usage.requestsToday} / ${usage.quota.requestsPerDay} requests`);
// Rotate / Revoke
const newKey = await client.keys.rotate('keyId123', 'user123');
await client.keys.revoke('keyId123', 'user123');
// Before
import { UnstructuredClient } from 'unstructured-client';
const client = new UnstructuredClient({ serverUrl: 'https://api.unstructured.io' });
// After — one import change
import { UnstructuredClient } from '@ailang/parse'
const client = new UnstructuredClient({
serverUrl: 'https://ailang-dev-docparse-api-ejjw6zt3bq-ew.a.run.app'
});
// All existing code works unchanged
const elements = await client.general.partition({ file: 'report.docx' });
import { DocParse, DocParseError, AuthError, QuotaError } from '@ailang/parse'
try {
const result = await client.parse('file.docx');
} catch (e) {
if (e instanceof AuthError) console.log('Bad API key');
else if (e instanceof QuotaError) console.log('Quota exceeded');
else if (e instanceof DocParseError) console.log(`API error: ${e.statusCode}`);
}
const client = new DocParse({
apiKey: 'dp_your_key',
baseUrl: 'https://your-deployment.run.app', // Custom endpoint
timeout: 120000, // Request timeout (ms)
});
Works in browsers with native fetch:
<script type="module">
import { DocParse } from './node_modules/@ailang/parse/src/index.js';
const client = new DocParse({ apiKey: 'dp_your_key' });
const health = await client.health();
console.log(health.status); // "healthy"
</script>
FAQs
JavaScript/TypeScript client and MCP server for the AILANG Parse document parsing API
The npm package @ailang/parse receives a total of 273 weekly downloads. As such, @ailang/parse popularity was classified as not popular.
We found that @ailang/parse 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.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.

Research
/Security News
Socket uncovered 77 linked Firefox extensions, including 40 that steal wallet secrets or credentials and 37 deceptive sports-score shells.