
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@espanol/cli
Advanced tools
Spanish translation CLI — translate text, docs, i18n files with dialect awareness
/**
import { Command } from "commander"; import { promises as fs } from "node:fs"; import type { SpanishDialect, TranslateOptions, MarkdownSection } from "@espanol/types"; import { parseMarkdown, reconstructMarkdown, } from "@espanol/markdown-parser"; import { validateMarkdownPath, createSecureTempPath } from "@espanol/security"; import type { ProviderRegistry } from "@espanol/providers";
interface TranslateReadmeOptions { dialect: string; output?: string; provider?: string; formal?: boolean; informal?: boolean; }
/**
Error: ${error.message});
throw error;
}
throw error;
}
});
}/**
// 2. Read file content const content = await fs.readFile(validatedPath, "utf-8");
// 3. Parse markdown const parsed = parseMarkdown(content);
if (parsed.sections.length === 0) { const result = ""; if (options.output) { await writeOutput(options.output, result); } else { console.log(result); } return; }
// 4. Get translation provider const registry = getRegistry(); const provider = options.provider ? registry.get(options.provider) : registry.getAuto();
// 5. Build translation options const translateOptions: TranslateOptions = { dialect: options.dialect as SpanishDialect, formality: options.formal ? "formal" : options.informal ? "informal" : undefined, };
// 6. Translate each translatable section const translatedSections: MarkdownSection[] = [];
for (const section of parsed.sections) { if (!section.translatable) { // Non-translatable sections keep original translatedSections.push(section); } else { // Translate the content const result = await provider.translate( section.content, "en", // Assume source is English "es", // Target is Spanish translateOptions );
// Create translated section
translatedSections.push({
...section,
content: result.translatedText,
});
}
}
// 7. Reconstruct markdown const translated = reconstructMarkdown(parsed.sections, translatedSections);
// 8. Write output if (options.output) { await writeOutput(options.output, translated); } else { console.log(translated); } }
/**
try { // Write to temp file await fs.writeFile(tempPath, content, "utf-8");
// Atomic rename to final path
await fs.rename(tempPath, filePath);
} catch (error) { // Clean up temp file on error try { await fs.unlink(tempPath); } catch { // Ignore cleanup errors } throw error; } }
FAQs
Spanish translation CLI — translate text, docs, i18n files with dialect awareness
The npm package @espanol/cli receives a total of 3 weekly downloads. As such, @espanol/cli popularity was classified as not popular.
We found that @espanol/cli 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.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.